• Post Reply Bookmark Topic Watch Topic
  • New Topic

convert array string value into number (integer)  RSS feed

 
Defa Lukman
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an array: [[a, b], [c, d], [e, f]]
Array value such as a, b, c, d, e and f must be converted to number (integer).
Let's say a = 0, b = 1, c = 2, ..., f = 5.
So, the result of converting should be: [[0, 1], [2, 3], [4, 5]]
Ho to do that in java?
 
Stephan van Hulst
Saloon Keeper
Posts: 7969
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Converting textual data to other data types is usually referred to as "parsing". Take a look at what methods the Integer class provides.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!