Morning All
I'm trying to trim a variable string "sItem"
sItem = "1. Equipment has all Speeds\Motions"
This is what I'm looking to do
sItem = "1"
This string is selected from a ListView. All the Items in the
list begin with a number followed by a period. All I want is the number.
Here's what I have - It is returning the whole string
What am I doing wrong?
John
I'm trying to trim a variable string "sItem"
sItem = "1. Equipment has all Speeds\Motions"
This is what I'm looking to do
sItem = "1"
This string is selected from a ListView. All the Items in the
list begin with a number followed by a period. All I want is the number.
Here's what I have - It is returning the whole string
B4X:
Sub ListView1_ItemClick (Position As Int, Value As Object)
Dim sItem As String
lblDefItemNo.Text = Value
sItem = lblDefItemNo.Text
sDefItem = LTrimSpaces(sItem)
ListView1.RemoveView
End Sub
Sub LTrimSpaces(s As String) As String
Dim i As Int
For i = 0 To s.Length - 1
If s.CharAt(i) <> "." Then
Return s.SubString(i)
End If
Next
End Sub
What am I doing wrong?
John