Android Programming Press on the image to return to the main documentation page.

MLStr

Written by Jem Miller

List of types:

MLStr

MLStr


Events:

None

Members:


  AposCheck (var As String) As String

  Copies (inp As String, num As Int) As String

  GetWords (StartWord As Int, NumWords As Int, Str As String) As String

  Hex (numb As Int) As String

  Initialize As String

  IsChar (ch As Char) As Boolean

  IsInitialized As Boolean

  IsPunct (ch As Char) As Boolean

  LastPos (Find As Char, Str As String) As Int

  NewLines (num As Byte) As String

  PosWord (wordNum As Int, Str As String) As Int

  Proper (line As String) As String

  Remainder As String

  Strip (line As String) As String

  StripIt (line As String, ch As Char) As String

  StripTo (line As String, find As String) As String

  Unique As String

  WordCnt (Str As String) As Int

  WordN (st As String, nm As Byte) As String

  Words (st As String) As Int

Members description:

AposCheck (var As String) As String
Checks to see if the string "var" contains apostrophies. If so, it puts them in a set of single quotes
This is primarily for SQL statements.
Copies (inp As String, num As Int) As String
Returns a string of "num" occurances of "inp"

copies("*",5) will return 5 *'s
GetWords (StartWord As Int, NumWords As Int, Str As String) As String
Returns NumWords form Str beginning at StartWord

This method ignores punctuation
Punctuation is defined as any character not in a-z, A-Z, or 0-9
all puntuation is counted as a word break like a space

st = getwords(2,5,"(this is)a test_of my-lib") Returns "is a test of"
Hex (numb As Int) As String
Returns the hex string value of a number
Initialize As String
Initializes the object.
IsChar (ch As Char) As Boolean
Checks to see if a character is a normal character (a-z, A-Z, or 0-9)
IsInitialized As Boolean
Tests whether the object has been initialized.
IsPunct (ch As Char) As Boolean
Checks to see if a character is punctuation (not a-z, A-Z, or 0-9)
LastPos (Find As Char, Str As String) As Int
Returns the last position of "Find" in "Str"
NewLines (num As Byte) As String
Returns "num" occurances of CRLF. This is useful for formatting text files

newlines(3) returns 3 linefeeds
PosWord (wordNum As Int, Str As String) As Int
Returns the character postion of the first letter of the Word at postion NumWord

i = PosWord(4,"This is a test test of the MLStr-library") returns 11 (the first letter of the word test)
Returns 0 if error
Proper (line As String) As String
Uppercases the first letter of EACH word in a string
Remainder As String
Strip (line As String) As String
Strips ALL spaces from "line"
StripIt (line As String, ch As Char) As String
Strips all occurances of the character "ch" from the string "line"
StripTo (line As String, find As String) As String
Returns everything in the string "line" up to the point where it finds the string "find".
Deletes everything before "find" and returns what is left in the Remainder string.
Find can be a single character or a string.

stripto("this is a string"," ") will return "this" and Remainder will equal "is a string"
Notice that the " " is gone from the return value AND in Remainder. This is
true of all find values sent to the routine. The find value is always deleted.
Unique As String
Returns a unique identifier based on the current date and time converted to hex
WordCnt (Str As String) As Int
Same as words
WordN (st As String, nm As Byte) As String
Returns word number "nm" from string "St"

wordn("this is a test",3) will return "a"
This method accounts for non- letters and non-numbers
Words (st As String) As Int
Returns the number of words in "St"

words("this is a test") will return 4.
This method accounts for punctuation including all non-letters or non-numbers
Top