Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

String as an array???  RSS feed

 
Suka Hati
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have a string. example like "i have ice-cream". how i can transform a string into an array so that each of the vowel and consonant can be recognize. examples :

word[0] = "i"
word[1] = " "
word[2] = "h"
...
word[15] = "m"

can somebody tell me???
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look carefully at the Javadoc for java.lang.String, and you will find a method that does exactly what you want. While you're looking, you'll see other interesting methods and remember them for later!
 
Jeff Bosch
Ranch Hand
Posts: 805
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read the API? Wow, what a concept!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!