I\'ve wondering is there a regex pattern that i could use to convert a pattern which is an underscore and a lowercase letter into an uppercase letter. I\'m trying to generat
You can use:
String s = "load_id,policy_id,policy_number";
Pattern p = Pattern.compile( "_([a-zA-Z])" );
Matcher m = p.matcher( s );
StringBuffer sb = new StringBuffer();
while (m.find()) {
m.appendReplacement(sb, m.group(1).toUpperCase());
}
m.appendTail(sb);
System.out.println(sb.toString()); // loadId,policyId,policyNumber