wood burning stoves 2.0*
The moose likes XML and Related Technologies and the fly likes how to capitalize first letter of string from value-of...? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "how to capitalize first letter of string from value-of...?" Watch "how to capitalize first letter of string from value-of...?" New topic
Author

how to capitalize first letter of string from value-of...?

Holmes Wong
Ranch Hand

Joined: Feb 18, 2002
Posts: 163
Hi,
I am wondering how to capitalize the first letter of the string
I get from the following xsl expression:

Could not figure it out by searching books....
thanks,
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
Well that would be a complex thing, but it could be done.
Using substring functions, get the first letter into a variable - firstLetter.
Similarly, get the rest of the string into another variable - restOfTheString
Then, use translate to translate the firstLetter to capital.
Concat the firstLetter to the restOfTheString.
Any better approaches....feel free
Regards.
- madhav


Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how to capitalize first letter of string from value-of...?
 
Similar Threads
Reverse the words in a string
Capitalize first letter in string
Case conversion problem
Converting a String to uppercase?
regex bug