hi how can i make sure that when user enter value there is no space between words example NEW YORK MUST BE NEW YORK
you mean this
That will ónly work for two spaces, anot for more or for other whitespaces.
so how can i replace any space more than one
this still not working
Have a look at the Pattern API:Pattern (Java Platform SE 7 )
java version "1.6.0_38"
Java(TM) SE Runtime Environment (build 1.6.0_38-b05)
Java HotSpot(TM) Client VM (build 20.13-b02, mixed mode, sharing)
u mean sValue = Pattern.matches(" ", "");
sorry what you saying
Have a look at the Pattern API, which I have linked, to find a regular expression that does what you need.