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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

checking a string

Status
Not open for further replies.

flyclassic22

Technical User
Oct 1, 2002
54
SG
Hi,
I would like to ask i've a variable string which i would like to write a checking statement
I would like to check if the string contain certain words before i process any other function.Let's say How do i check. Let say i would like to check if a string contains ":\"
from a string??

 
if 0 < Instr(1,strW,&quot;:\&quot;) then
...string contains
End if
'For case-insensitive search for text
if 0 < Instr(1,strW,&quot;ab&quot;,1) then
...string contains &quot;ab&quot;, &quot;aB&quot;, &quot;Ab&quot; or &quot;AB&quot;
End if


Forms/Controls Resizing/Tabbing Control
Compare Code (Text)
Generate Sort Class in VB or VBScript
 
hi, I've another doubt, how do i detect if it's empty? for previous i've been detecting &quot;:\&quot;
how do i detect if the whole string is empty from user's input?
 
If the whole string is not empty:
If myStr <> &quot;&quot; Then
'string is not empty
Else
'string is empty
End If

-Tarwn --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
For my next trick I will pull a hat out of a rabbit (if you think thats bad you should see how the pigeon feels...) :p
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top