| Author |
Strings Problem
|
siddu banjapally
Greenhorn
Joined: Aug 16, 2011
Posts: 13
|
|
Hi friends..
I have one doubt that is, I have one string as following
String s="a1b2c3 dd4f5g10h11z";
then how can I print only alphabets or numbers only??
|
 |
Vijay Tidake
Ranch Hand
Joined: Nov 04, 2008
Posts: 146
|
|
Hi,
Try this.
Edit: removed complete solution.
Thanks
|
The important thing is not to stop questioning.Curiosity has its own reason for existing.
|
 |
Wouter Oet
Saloon Keeper
Joined: Oct 25, 2008
Posts: 2700
|
|
@Vijay: I've removed your complete solution. See the forum description:
We're all here to learn, so when responding to others, please focus on helping them discover their own solutions, instead of simply providing answers.
@siddu
Hi and welcome to the JavaRanch!
Try to iterate through the string and check if each character is a number/somethingElse.
|
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
|
 |
Vijay Tidake
Ranch Hand
Joined: Nov 04, 2008
Posts: 146
|
|
Hi Wouter Oet,
Thanks for reminding me the rule. Onward I will follow it.
Thanks
|
 |
bhanu chowdary
Ranch Hand
Joined: Mar 09, 2010
Posts: 256
|
|
@siddu
Welcome to javaranch
|
 |
fred rosenberger
lowercase baba
Bartender
Joined: Oct 02, 2003
Posts: 9939
|
|
if you didn't have a computer, how would you do it with pencil and paper? explain step by step what you would do.
Once you have that (and I literally mean for you to write it down), it's easy to code.
|
Never ascribe to malice that which can be adequately explained by stupidity.
|
 |
siddu banjapally
Greenhorn
Joined: Aug 16, 2011
Posts: 13
|
|
THANKS to all
Siddu
|
 |
suryakanta sahoo
Greenhorn
Joined: Aug 20, 2011
Posts: 5
|
|
|
|
 |
 |
|
|
subject: Strings Problem
|
|
|