Any (direct) way to lowercase a string.

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
I'm trying to search for text in a file ignoring case. Is there direct way to do such a search ignoring case or, alternatively, to change a string to all upper or lowercase?
 

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
Sub Globals

Dim Buffer As String

End Sub

...

Buffer = "sOme StRING"

Query = Buffer.ToLowerCase

Oh, wow! I appreciate your response, which is just what I was looking for, but it gives me some very bad/surprising news -- a search using either this forum's or the Wiki's search boxes only returns hits for complete word matches.

For example, if you search in either place for lowercase, it will not list hits for ToLowerCase as a similar search would in most places, including the B4A IDE.

This makes it much harder to locate information in either the forums or the Wiki, as my failure to find ToLowerCase shows.
 
Upvote 0

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
Or:
B4X:
    Dim s1, s2 As String
    If s1.EqualsIgnoreCase(s2) Then ...

I found that one, but I believe it is just used for comparing two strings rather than looking for a string within a file as I was trying to do.

Please see my note above about searches. If you have any control over the way the forum software works, it would sure be nice to have that fixed. Even if I had been aware of the forum search's limitation, I would never have found ToLowerCase because you have to know that word to search for it; i.e.: you can't just search for lowercase and hope to find related words. That defeats a lot of searches.
 
Upvote 0
Top