nfordbscndrd Well-Known Member Licensed User Longtime User Aug 22, 2011 #1 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?
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?
NJDude Expert Licensed User Longtime User Aug 22, 2011 #2 Sub Globals Dim Buffer As String End Sub ... Buffer = "sOme StRING" Query = Buffer.ToLowerCase Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Aug 22, 2011 #3 Or: Code: Copy Dim s1, s2 As String If s1.EqualsIgnoreCase(s2) Then ... Upvote 0
nfordbscndrd Well-Known Member Licensed User Longtime User Aug 23, 2011 #4 NJDude said: Sub Globals Dim Buffer As String End Sub ... Buffer = "sOme StRING" Query = Buffer.ToLowerCase Click to expand... 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
NJDude said: Sub Globals Dim Buffer As String End Sub ... Buffer = "sOme StRING" Query = Buffer.ToLowerCase Click to expand... 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.
nfordbscndrd Well-Known Member Licensed User Longtime User Aug 23, 2011 #5 Erel said: Or: Code: Copy Dim s1, s2 As String If s1.EqualsIgnoreCase(s2) Then ... Click to expand... 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
Erel said: Or: Code: Copy Dim s1, s2 As String If s1.EqualsIgnoreCase(s2) Then ... Click to expand... 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.