• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Holmes Wong
Ranch Hand
Posts: 163
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5040
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic