iOS Question Return Application.LabelName

Mashiane

Expert
Licensed User
Longtime User
Thanks, so to return the last part of the package name, one could then...

B4X:
Sub ApplicationLabel() As String
    Dim pn As String = GetPackageName
    Dim al As String = MvField(pn,3,".")
    Return al
End Sub

Sub MvField(sValue As String, iPosition As Int, Delimiter As String) As String
   If sValue.Length = 0 Then Return ""
   Dim xPos As Int: xPos = sValue.IndexOf(Delimiter)
   If xPos = -1 Then Return sValue
   Dim mValues() As String
   Dim tValues As Int
   mValues = Regex.split(Delimiter, sValue)
   tValues = mValues.Length -1
   Select Case iPosition
   Case -1
     Return mValues(tValues)
   Case -2
     Return mValues(tValues - 1)
   Case Else
     iPosition = iPosition - 1
     If iPosition <= -1 Then Return mValues(tValues)
     If iPosition > tValues Then Return ""
     Return mValues(iPosition)
   End Select
End Sub

This will do...
 
Upvote 0
Top