This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

toCharArray()

 
Mike Shn
Ranch Hand
Posts: 149
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
I copied small program and compiled. But I don't understand the purpose of toCharArray() function in Java. Can someone help me?
Thanks
 
Val Dra
Ranch Hand
Posts: 439
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it just creates an array of characters from a supplied string. They just give you the api you have to make a decision where to use it or not. I used it once where i want it to read the string backwards so i made char array using this method and then just looped from last element to first and constructed a new string in reverse order.
 
rani bedi
Ranch Hand
Posts: 358
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
public char[] toCharArray()
This function converts the string to a new character array. It returns a newly allocated character array whose length is the length of the string and whose contents are initialized to contain the character sequence represented by this string.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic