for (int i = 0; i!=special_chars.length(); i++) { if (value==special_chars[i]) return true; } return false; }
I dont think it likes this line special_chars.length()
Manfred Leonhardt
Ranch Hand
Joined: Jan 09, 2001
Posts: 1492
posted
0
Hi Anthony, You are correct. The method length is not defined for arrays. It is defined for String however: String s = "Yesterday"; int i = s.length(); // Equals 9. You want the field length that is defined for arrays: String[] as = {"Yesterday", "Today", "Tommorrow"}; int i = as.length; // Equals 3. Regards, Manfred.
Peter Simard
Ranch Hand
Joined: Oct 31, 2001
Posts: 54
posted
0
length is a property of Arrays, so you could use spec_char.length
PAS<br />peter@panvox.net<br />2b || !2b
Colin Kenworthy
Ranch Hand
Joined: Aug 06, 2001
Posts: 88
posted
0
Yes, length is not a method but a property of arrays so you just need to drop the '()'.