Iterate or loop through lines in EditText

b4AMarkO

Member
Licensed User
Longtime User
Can this be done in B4A?
If so How do you do it?

I seem to recall that in a RTB in vb you could do it something like this

Code:
For Each line in RTB1.Lines
   If line.Contains("Apple" Then
      ' Do what you need to do here
   End If
Next

So can I do something like this to an EditText?
 
Not directly but you can split the text to an array using Regex and the iterate over the array:

Code:
Dim TextArray() As String
TextArray = Regex.Split(CRLF,EditText1.Text)

For Each Line As String In TextArray
   Log(Line)
Next
 
Upvote 0
Not directly but you can split the text to an array using Regex and the iterate over the array:

Code:
Dim TextArray() As String
TextArray = Regex.Split(CRLF,EditText1.Text)

For Each Line As String In TextArray
   Log(Line)
Next

Yes that will getter done .. Thank you very much
 
Upvote 0
Back
Top