View Single Post
  #2 (permalink)  
Old 01-16-2008, 05:48 PM
AralX AralX is offline
Member
 
Join Date: Dec 2007
Location: KSA, Riyadh
Posts: 9
AralX is on a distinguished road
I have an Idea , which is a very simple ..
----------------------------------------
String str = "abc(xyz",newStr="";
for(int x=0; x<str.length();x++)
if(str.charAt(x)>='a' ||str.charAt(x)>='z' )//a ssuming they are all lower cases
newStr =""newStr+str.charAt(x);

-------------------------------------------------

I hope that helped - this code will only print letters while ..this -below- will not print this pranthes

----------------------------------------
String str = "abc(xyz",newStr="";
for(int x=0; x<str.length();x++)
if(str.charAt(x)!='(' )

newStr =""newStr+str.charAt(x);

-------------------------------------------------
Reply With Quote