B4A Stringfunctions: Written by Margret
B4A Stringfunctions: Written by Margret
B4A Stringfunctions: Written by Margret
Written by Margret
List of types:
StringFunctions
StringFunctions
Events:
None
Members:
AddSpaces (HowMany As Int) As String
AsciiCodes As String
At (YourString As String, SearchFor As String) As Int
CurrentWeek (MyDate As String) As Int
DayOfMonth (MyDate As String) As Int
Decrypt (YourText As String) As String
Empty (StringText As String) As Boolean
Encrypt (YourText As String) As String
FileExist (PathAndFileName As String) As Boolean
iif (Value1 As String, Value2 As String, Value3 As String) As String
Initialize As String
InString (YourString As String, SearchFor As String) As Long
IsEmpty (StringText As String) As Boolean
IsInitialized As Boolean
Left (StringText As String, Length As Long) As String
Len (StringText As String) As Long
Members description:
AddSpaces (HowMany As Int) As String
Returns a string of spaces. The number returned is set by HowMany.
AsciiCodes As String
Displays a MessageBox with all Characters and their ASCII codes.
At (YourString As String, SearchFor As String) As Int
Returns the position of the SearchFor within YourString.
CurrentWeek (MyDate As String) As Int
Returns the number of the current week, 1-52 from the date passed to MyDate.
DayOfMonth (MyDate As String) As Int
Returns the day of the month like 1-31, from the date passed to MyDate.
Decrypt (YourText As String) As String
Converts an encrypted string of text to readable format.
Empty (StringText As String) As Boolean
Test to see if the string is empty and returns True if it is, otherwise returns False.
Encrypt (YourText As String) As String
Converts a string of text to simple encryption.
FileExist (PathAndFileName As String) As Boolean
Returns True if the filename passed does exist, otherwise returns False.
Be sure to include the path like:
If FileExist("/mnt/sdcard/mydata.dat") Then MsgBox("Yes", "The Answer")
iif (Value1 As String, Value2 As String, Value3 As String) As String
This is a single line if conditional test. If Value1 is true, Value2 is returned,
otherwise
Value3 will be returned. Works with strings and booleans.
Example:
MsgBox(iif("Bob"="Jim", "They are the same", "They are not the same"), "The
Answer")
or
MyBoolean = iif(FirstTime = True, StartMyService = True, StartMyService =
False)
Initialize As String
Initializes the object for use.
InString (YourString As String, SearchFor As String) As Long
Returns the position of the SearchFor within YourString.
IsEmpty (StringText As String) As Boolean
Test to see if the string is empty and returns True if it is, otherwise returns False.
IsInitialized As Boolean
Tests whether the object has been initialized.
Left (StringText As String, Length As Long) As String
Returns the Left portion of a string with the number of characters passed
in Length.
Len (StringText As String) As Long
Returns the length of the string.
Lower (StringText As String) As String
Returns the string converted to Lowercase characters.
Ltrim (StringText As String) As String
Returns a new string with the leading spaces removed.
MB (Message As String) As String
Same as MsgBox but only needs one parameter.
Mid (StringText As String, Start As Int, Length As Int) As String
Returns the a new String for how ever many characters passed in Length from
a starting position passed in Start.
Example:
Mid(This is a long line of text, 5, 2)
In this example the function will Return: "is"
Month (MyDate As String) As Int
Returns the number of the current month 1-12 as Int type, from the date passed
to MyDate.
MonthName (MyDate As String) As String
Returns the Name the current month as a String like January, etc., from the date
passed to MyDate.
NewDate (DatePassed As String, HowManyDays As Int) As String