Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
karthik_T
Contributor
Contributor

camel case of letters

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.

Labels (3)
4 Replies
Anonymous
Not applicable

Hello,

Could you please elaborate your case with an example with input and expected output values?

Best regards

Sabrina

karthik_T
Contributor
Contributor
Author

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.

ankit7359
Creator II
Creator II

hi karthik,
have you created a routine..
can you pls share.. what approach you have followed
karthik_T
Contributor
Contributor
Author

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;
}