I’m trying with no chance to transform sql attributes to java format.
Let’s have an example: I want to change: “p_start_date” to “pStartSate”.
I’ve tried to use
String var = "p_start_date";
var.replaceAll("(_[a-z])\1", "([A-Z])\1");
and also
Pattern pattern = Pattern.compile("([a-z0-9]+_)*");
Matcher matcher = pattern.matcher(var);
if (matcher.find()) {
// Get all groups for this match
//System.out.println(matcher.groupCount());
for (int i=0; i<=matcher.groupCount(); i++) {
String groupStr = matcher.group(i);
System.out.println(groupStr);
}
}
But both doesn’t work
Is this what you are looking for?
output: pStartDate