|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
How do you search a word within a string?
<i><b>Originally posted by : Vennie (petitecorn@rcn.com)</b></i><br />Hi:<br /><br />I was wondering if anybody can help me with this. I need to search for a word within a string(such as returning true if the program finds the word "you" in the string "how do you do this?") Any help would be appreciated. Thank you.<br /><br />Ven.<br />
|
|
#2
|
|||
|
|||
|
<i><b>Originally posted by : Karl (zeepoh@wt.net)</b></i><br /><br />Ven,<br />Use the instring function. It searches for a text string within another. The syntax for it is:<br /><br />instr(<start>,string 1, string 2, <compare>)<br /><br />this function returns the start position where it string 2 within string 1. if it returns a value of 0 then string 2 doesn't exist within string 1. the first parameter denotes the position where instr starts searching and the last parameter denotes which type of comparison it does (0 for case sensitive and 1 for case insensitive)<br /><br />Hope this helps!<br /><br />------------<br />Vennie at 2/28/2000 10:36:20 AM<br /><br />Hi:<br /><br />I was wondering if anybody can help me with this. I need to search for a word within a string(such as returning true if the program finds the word "you" in the string "how do you do this?") Any help would be appreciated. Thank you.<br /><br />Ven.<br />
|
|
#3
|
|||
|
|||
|
<i><b>Originally posted by : Venie Wijaya (petitecorn@rcn.com)</b></i><br />Whew, thanks. I forgot that about that command. I tried looking it up in my book, but couldn't find it. =)<br /><br />Ven.<br /><br /><br />------------<br />Karl at 3/1/2000 9:19:30 AM<br /><br /><br />Ven,<br />Use the instring function. It searches for a text string within another. The syntax for it is:<br /><br />instr(<start>,string 1, string 2, <compare>)<br /><br />this function returns the start position where it string 2 within string 1. if it returns a value of 0 then string 2 doesn't exist within string 1. the first parameter denotes the position where instr starts searching and the last parameter denotes which type of comparison it does (0 for case sensitive and 1 for case insensitive)<br /><br />Hope this helps!<br /><br />------------<br />Vennie at 2/28/2000 10:36:20 AM<br /><br />Hi:<br /><br />I was wondering if anybody can help me with this. I need to search for a word within a string(such as returning true if the program finds the word "you" in the string "how do you do this?") Any help would be appreciated. Thank you.<br /><br />Ven.<br />
|
![]() |
| Viewing: ASP Free Forums > Programming > ASP Development > How do you search a word within a string? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|