Convert String to Integer or int

By neokrates, written on April 14, 2010

groovy   snippet

Rate it
  • 1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 3 out of 5)
    Loading ... Loading ...
Ad
Poll
  • Best general purpose programming language is?

    View Results

    Loading ... Loading ...
Feeds:
  • bodytext bodytext bodytext
Most popular search terms:
Stats
    Since publication, this page was visited 1159 time(s).

Convert String to Integer or int in Groovy

String intValStr="10"
int intVal = intValStr as int
Integer intVal1 = intValStr as int
println(intVal+","+intVal1)

String floatValStr="10.1"
float floatVal = floatValStr as float
Float floatVal1 = floatValStr as float
println(floatVal+","+floatVal1)
 
Does that help to solve your problem?
VN:F [1.8.5_1061]
Rating: -3 (from 3 votes)
0 votes 'YES'  3 votes 'NO'
TAGS
No tags for this post.
RELATED
Pages
Posts
    nope :(
SOCIAL
Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • BlinkList
  • Blogosphere News
  • E-mail this story to a friend!
  • Furl
  • LinkArena
  • Live
  • MisterWong
  • Print this article!
  • StumbleUpon
  • Technorati
  • Webnews.de
  • YahooMyWeb

Leave a Reply