Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I want to convert the first letter of the name to upper case and the rest of the letters to down case. even after the space between the letters also, how to do using tmap.
Hello,
Could you please elaborate your case with an example with input and expected output values?
Best regards
Sabrina
Hi Xdshi,
Thanks for your quickly reply. my input & output as below.
input : tom crew
output: Tom crew
I got the result by calling routine.
Hi Ankit,
use the below routine.
public static String titleCase(String text)
{
String result = "";
if(isFieldBlank(text))
return "";
String input = text.trim().toLowerCase();
char firstChar = input.charAt(0);
result = result + Character.toUpperCase(firstChar);
for (int i = 1; i < input.length(); i++) {
char currentChar = input.charAt(i);
result = result + currentChar;
return result;
}
private static boolean isFieldBlank(String text) {
// TODO Auto-generated method stub
return false;
}