This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to convert a string to char?  RSS feed

 
Ramu Rondla
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friends,
Is there any way to convert a string to char?
example "java" to 'java'

Thanks,
Ramu
 
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
"java" is four characters -- it doesn't make sense to ask about converting a string to a single character. "java".charAt(0) is the first one ('j') and "java".charAt(3) is the last one ('a').
 
William Barnes
Ranch Hand
Posts: 1049
2
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See examples here: click
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!