WordBASIC InStr Function Is Case Sensitive

ID: Q61960

The information in this article applies to:

The WordBASIC InStr function is case sensitive. For example, a search for the string "Test String", as in

   N = InStr(A$, "Test String")

returns a valid position number only if the string "Test String" is present in A$. "TEST STRING" and "test string" are not found by the InStr function.

To work around this problem, use one of the following:

   N = InStr(LCase$(A$), "test string")

  -or-

   N = InStr(UCase$(A$), "TEST STRING")

The LCase$ and UCase$ functions return their arguments (in this case, the text of A$) in either lowercase text or uppercase text respectively, without modifying the original string. As a result, either method is effective for case-insensitive text searches.
Keywords          : kbmacro winword word6 winword2 
Version           : 1.x 2.x 6.0 6.0a 6.0c
Platform          : WINDOWS

Last Reviewed: July 31, 1997