|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
check if a string is more than 30 chars
How do i do a check to see if the user input string is more than 30 chars without the inclusion of spaces.
Eg 1: abcdefghijklm nopqrstuvwxyz 12345 (this string contains 31 chars not including sapces and will be disallowed) Eg2: 1234567890 1234567890 123456789 (this string contains 29 chars not including sapces and therefore it is allowed.) Thanks... pls help asap... Codes will be very helpful |
|
#2
|
|||
|
|||
|
Step 1: Use a StringTokenizer to split the string apart on the spaces.
Step 2: Use a while loop to the put the string back together without spaces. Step 3: Use length() to test the new string. I know you can do this. I have faith . |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > check if a string is more than 30 chars |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|