> One of my servlet's receives a parameter in the form of a string, is
> there anyway I can search this string and find if there are any spaces
> in it?
> And if so is there anyway of changing the space with a plus sign?

>From the String API-docs (why look farther than neccesary ;-):

public String replace(char oldChar, char newChar)
        Returns a new string resulting from replacing all occurrences of oldChar in
this string with newChar. If the character oldChar does not occur in the
character sequence represented by this String object, then a reference to
this String object is returned. Otherwise, a new String object is created
that represents a character sequence identical to the character sequence
represented by this String object, except that every occurrence of oldChar
is replaced by an occurrence of newChar.

..

Parameters:
oldChar - the old character.
newChar - the new character.

Returns:
a string derived from this string by replacing every occurrence of oldChar
with newChar.


AH

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to