• Post Reply Bookmark Topic Watch Topic
  • New Topic

Program to get the numbers seperated from the characters in the given string  RSS feed

 
akshitha Akki
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



This program works for the string have the characters in one case, if the string have the both upper and lower cases it does not segregate correctly.Can someone provide help on this.
 
Winston Gutkowski
Bartender
Posts: 10573
65
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
akshitha Akki wrote:This program works for the string have the characters in one case, if the string have the both upper and lower cases it does not segregate correctly.Can someone provide help on this.

Yes. Have a look at Character.isLetter() - and/or indeed Character.isDigit() - what if it isn't either?.

Winston
 
akshitha Akki
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



This code works for the seperate lists of numbers and chars from the given string.Is there any other way it can be done? just curious to know about the different ways to do the same task
 
akshitha Akki
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Winston. The functions you had specified helped a lot and it made the program easy as well.Indeed it helped me to get knowledge on other functions from the Character class.
 
Winston Gutkowski
Bartender
Posts: 10573
65
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
akshitha Akki wrote:Thanks Winston. The functions you had specified helped a lot and it made the program easy as well.Indeed it helped me to get knowledge on other functions from the Character class.

You're welcome. It's amazing what you can find in those API docs. Personally, I always have a copy open on my desktop when I'm working, even after 12 years of writing Java.

Winston
 
Richard Tookey
Bartender
Posts: 1166
17
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
akshitha Akki wrote:
Is there any other way it can be done?

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!