Skip to content

Class Text

Kristian Virtanen edited this page Oct 28, 2024 · 2 revisions

Description:

The Text class provides methods for performing text manipulations such as concatenation, searching, case conversion, and substring operations. The class also includes error handling via the LastError property, which stores the most recent error message if an operation fails.

Properties

Text.LastError

  • Description: Stores the last error message, if any operation fails, including a timestamp in yyyy-MM-dd HH:mm:ss format.
  • Example: "2024-10-16 14:30:00: Invalid substring operation."
  • Changes from orig. SB: New feature for SBOE.

Methods

Text.Append(text1, text2)

  • Description: Appends two text inputs and returns the result.
  • Parameters:
    • text1: The first text input.
    • text2: The second text input to append.
  • Returns: The result of appending text2 to text1.
  • Changes from orig. SB: none.

Text.GetLength(text)

  • Description: Returns the length of the given text.
  • Parameters:
    • text: The input text.
  • Returns: The length of the text.
  • Changes from orig. SB: none.

Text.IsSubText(text, subtext)

  • Description: Checks if subText is part of the main text.
  • Parameters:
    • text: The main text to search within.
    • subText: The text to search for within the main text.
  • Returns: true if subText is found in the main text, otherwise false.
  • Changes from orig. SB: none.

Text.EndsWith(text, subText)

  • Description: Checks if the text ends with the specified subText.
  • Parameters:
    • text: The main text.
    • subText: The text to check for at the end of the main text.
  • Returns: true if the main text ends with subText, otherwise false.
  • Changes from orig. SB: none.

Text.StartsWith(text, subtext)

  • Description: Checks if the text starts with the specified subText.
  • Parameters:
    • text: The main text.
    • subText: The text to check for at the beginning of the main text.
  • Returns: true if the main text starts with subText, otherwise false.
  • Changes from orig. SB: none.

Text.GetSubText(text, start, length)

  • Description: Gets a substring from the given text, starting at a specified position and with the given length.
  • Parameters:
    • text: The input text.
    • start: The starting position (1-based index).
    • length: The number of characters to include in the substring.
  • Returns: The substring from the specified position and length.
  • Changes from orig. SB: none.

Text.GetSubTextToEnd(text, start)

  • Description: Gets a substring from the given text, starting at a specified position and extending to the end of the text.
  • Parameters:
    • text: The input text.
    • start: The starting position (1-based index).
  • Returns: The substring from the specified starting position to the end of the text.
  • Changes from orig. SB: none.

Text.GetIndexOf(text, subText)

  • Description: Finds the position where subText first appears in the main text.
  • Parameters:
    • text: The main text to search within.
    • subText: The text to find within the main text.
  • Returns: The 1-based index of the first occurrence of subText, or 0 if not found.
  • Changes from orig. SB: none.

Text.ConvertToLowerCase(text)

  • Description: Converts the given text to lowercase.
  • Parameters:
    • text: The input text.
  • Returns: The input text converted to lowercase.
  • Changes from orig. SB: none.

Text.ConvertToUpperCase(text)

  • Description: Converts the given text to uppercase.
  • Parameters:
    • text: The input text.
  • Returns: The input text converted to uppercase.
  • Changes from orig. SB: none.

Text.GetCharacter(characterCode)

  • Description: Gets a character corresponding to the specified Unicode code.
  • Parameters:
    • characterCode: The Unicode code of the character.
  • Returns: The character that corresponds to the specified Unicode code.
  • Changes from orig. SB: none.

Text.GetCharacterCode(character)

  • Description: Gets the Unicode code for the specified character.
  • Parameters:
    • character: The character to get the Unicode code for.
  • Returns: The Unicode code of the specified character.
  • Changes from orig. SB: none.

Text.InvertText(text)

  • Description: Inverts the given text.
  • Parameters:
    • text: The text to invert.
  • Returns: The inverted text.
  • Changes from orig. SB: New feature for SBOE.

Text.LeftTrim(text)

  • Description: Trims leading whitespaces away from string. IE: " abc" returns as "abc"
  • Parameters:
    • text: The text to trim.
  • Returns: The trimmed text.
  • Changes from orig. SB: New feature for SBOE.

Text.RightTrim(text)

  • Description: Trims trailing whitespaces away from string. IE: " abc " returns as " abc"
  • Parameters:
    • text: The text to trim.
  • Returns: The trimmed text.
  • Changes from orig. SB: New feature for SBOE.

Text.Trim(text)

  • Description: Trims leading and trailing whitespaces away from string. IE: " abc " returns as "abc"
  • Parameters:
    • text: The text to trim.
  • Returns: The trimmed text.
  • Changes from orig. SB: New feature for SBOE.

Text.Str(number)

  • Description: Converts a number to a string.
  • Parameters:
    • number: The number to convert.
  • Returns: The string representation of the number.
  • Changes from orig. SB: New feature for SBOE.

Top

Clone this wiki locally