I have a page in whic user enters values and submits the form. I want to know if there is any function to check if the user enters spaces in between the word. If anybody knows how to do it please let me know.
Bear Bibeault
Author and opinionated walrus
Marshal
Well that's obviously too specific a function to already be part of the String class, but all the tools you need are right there in the String class to write your own. You can either search for an instance of the space character (if all you are interested in is whether the string has a space or not), loop through the characters of the string looking for the space character (if you need to count them or some such), or you can use a regular expression if you are looking to detect patterns that are a little more complex than that. Why not try writing up your own version of a method "doesStringHaveSpaces()" and if you have any difficulties with it, post your code and you'll be sure to get some help with it. Don't expect anyone to write the code for you though; that's not the purpose of this site. hth, bear [ April 04, 2003: Message edited by: Bear Bibeault ]