S stratus Active Member Licensed User Longtime User Mar 11, 2011 #1 I have a text which contains this phrase studentName="A Name" and i want to use the indexOf function to find the position of the phrase,but i can not because the phrase has quotes.Is any way to find the position of the phrase?
I have a text which contains this phrase studentName="A Name" and i want to use the indexOf function to find the position of the phrase,but i can not because the phrase has quotes.Is any way to find the position of the phrase?
G glook Member Licensed User Longtime User Mar 11, 2011 #2 Here you go, try one of these: B4X: Dim text2test as String ' this would hold your input text Dim pos as Int pos = text2text.IndexOf("studentName=" & QUOTE & "A Name" & QUOTE) or alternatively B4X: pos = text2text.IndexOf("studentName=~A Name~".Replace("~", QUOTE)) Upvote 0
Here you go, try one of these: B4X: Dim text2test as String ' this would hold your input text Dim pos as Int pos = text2text.IndexOf("studentName=" & QUOTE & "A Name" & QUOTE) or alternatively B4X: pos = text2text.IndexOf("studentName=~A Name~".Replace("~", QUOTE))