Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

String Handling

Status
Not open for further replies.

SHAWTY721

Programmer
Aug 16, 2007
116
US
I am working in VB6 I have a form that contains a text box and I need to see if the user has ended the entry with a "\" and if not I will need to add it to the end of the users entry into the text box programmatically. I am wondering how this can be done, I am attempting to use the Right Function I am not sure if I am going about this the right way or not. Any help would be greatly appreciated.

Thanks in advance!
 
if not right(textbox.text,1)="\" then
textbox.text=textbox.text & "\"
end if
 

Just to be sure I would:
Code:
if not right([blue]Trim$([/blue]textbox.text[blue])[/blue],1)="\" then
    textbox.text=[blue]Trim$([/blue]textbox.text[blue])[/blue] & "\"
end if
in case user puts some spaces at the end.

Have fun.

---- Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top