So, this feature needs a volunteer to implement it.
Done.
Current implementation is
|
Jabaco Source
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
public static String PCase(String String1) {
String String2 = "";
boolean lastWasLetter = false;
for (int i=0; i<=String1.length()-1; i++) {
Character ch = String1.charAt(i);
if (Character.isLetterOrDigit(ch)) {
if (Character.isDigit(ch)) {
String2 = String2.concat(ch.toString());
} else if (lastWasLetter) {
String2 = String2.concat(ch.toString().toLowerCase());
lastWasLetter = true;
} else {
String2 = String2.concat(ch.toString().toUpperCase());
lastWasLetter = true;
}
} else {
String2 = String2.concat(ch.toString());
lastWasLetter = false;
}
}
return (String2);
}
|
The last change was, that I made it to public, so that it is possible to use it direct as PCase(String) like it is possible with UCase and LCase.
If you think it would be better to call it only over StrConv, then I will change it back to private.
Greatings
theuserbl