I've been trying to create a new TextMate snippet that allows me to create the Getters / Setters for Java.
Currently this is all I can come up with:
public void set${1:Var}(String $1){
this.$1 = $1;
}
public String get$1(){
return $1;
}
However, my desired snippet should take the currently selected text, eg. name
and produce the following output:
public String getName(){
return this.name;
}
public void setName(String name){
this.name = name;
}
To summarize, I need to be able to:
- Get the user's selected text
- Capitalize the first character of the selected text
Can this be done?