beag Posted July 13, 2012 Share Posted July 13, 2012 Hello,Is it possible to convert string in report so as to get instead of "john smith" - just "John Smith" (the first letter in each word is capital letter and the rest are small letters)? Thank you in advance for any help. Link to comment Share on other sites More sharing options...
cmatthews Posted July 13, 2012 Share Posted July 13, 2012 I'm pretty sure you could use the pattern object and a regular expression string.replace() ... If you look up regular expression for groovy or java to do this you should find plenty of options. Link to comment Share on other sites More sharing options...
beag Posted July 16, 2012 Author Share Posted July 16, 2012 Thank you for your tips, but as I'm not familiar with java and groovy, I'd be greatful if seomebody gives me some examples how to solve my problem. Thanks Link to comment Share on other sites More sharing options...
zeltner Posted July 16, 2012 Share Posted July 16, 2012 you could use the apache commons-lang library (http://commons.apache.org/lang/). There is method WordUtils.capitalize(..) which does what you want. Code:<textFieldExpression class="java.lang.String"> org.apache.commons.lang.WordUtils.capitalize($F{field})</textFieldExpression> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now