PDA

View Full Version : Problem with SPACE


augean
06-15-2003, 05:02 AM
Hi
I have a problem in registration .

when someone is filling the registration form at Username field ,
I want to check that if there is a SPACE in username like ( Aug Mug ) in check that and alert user to user underline ( Aug_Mug ) or without space .

I used trim but trim looks at the start and end of the variable not between .

TNX
~Augean

augean
06-15-2003, 05:14 AM
a little more ...

Just like yahoo or msn , when you want register a username , you are needed to have staright word for username , and alowed to have space in your username , how can I check and find that Space in username ?

TNX ALOT
~Augean

Whitesword
06-15-2003, 08:40 AM
Why not just use Instr() to look for the space?

If Instr( username, " ") > 0 Then
'Illegal name stuff... possible redirect
Else
'Continue processing
End If

Kodo
06-15-2003, 10:28 AM
or you do something like this

Function AddUScore(strName)

strName=Trim(replace(strName," ","_"))

AddUscore=strName

End Function



then just pass the variable to the function

FirstName=AddUscore(FirstName)

augean
06-16-2003, 02:52 AM
Thank you ,

both answers are exactly what I was looking for :))

Thank you all
~Augean