java - How to convert a string to camel case in phpstorms (velocity based) file tempates? -
java - How to convert a string to camel case in phpstorms (velocity based) file tempates? -
what i've tried far is:
## $name 'my_controller_c' #set($name = $name.removeandhump($name)) #set($name = $name.underscorestocamelcase(string)
but not work. first 1 nothing, sec 1 throws java error.
i tried using regular expressions , loop through string, java knowledge basic.
this is, ended doing:
#set($ctrlname = $name.replaceall("-c$", "")) #set($ctrlnewname = "") #foreach($str in $ctrlname.split("-")) #set($str = $str.substring(0,1).touppercase()+$str.substring(1)) #set($ctrlnewname = $ctrlnewname + $str) #end #set ( $ctrlnewname = $ctrlnewname + "ctrl" )
java intellij-idea phpstorm velocity
Comments
Post a Comment