View Single Post
Old 01-13-2005, 02:05 AM   PM User | #3
cfc
Regular Coder

 
Join Date: Dec 2004
Location: Keswick, Ontario
Posts: 251
Thanks: 0
Thanked 0 Times in 0 Posts
cfc is an unknown quantity at this point
fillIt=new String (theSntnc.getText());

Correct me if I'm wrong, but isn't the "new String( ... )" unnecessary?

sntncArray[wrdCnt]=sntnc.substring(0,x-1);

I believe substring excludes the last index you specify. Therefore, the -1 will probably return one less character than you want per word.

I'm a little out of practice with Java so I can't dissect your code (however small it is) ATM, and my suggestions probably won't fix your problem. I'll continue looking at it though . However, if this is purely for personal experimentation (and not something you plan to put on the internet where nobody is guaranteed to have JRE 1.4), the String object has had a split(String regex) method since 1.4.

Last edited by cfc; 01-13-2005 at 02:26 AM..
cfc is offline   Reply With Quote