Android Question read caracters from a string

Rachbob

Member
Licensed User
hello everyone,

in a EditText i need to separate some words from the input text..
i use (EditText.SetSelection) and (EditText .SelectionLength) but i dont know how to copy the selected string:

Dim A As Int

EditTextH.SelectAll
A=EditTextH.SelectionLength
EditTextH.SetSelection(1,A-1)
' nedd her to copy the selected text
End Sub
 

Star-Dust

Expert
Licensed User
B4X:
Dim Text as String = EditTextH.Text.SubString2(StartIndex,EndIndex)
Dim Text as String = EditTextH.Text.SubString(StartIndex)
You don't need to select the text to be able to copy it. Just use the string methods to get a substring.
 
Last edited:
Top