Kajona\System\System\StringUtil

Util class for processing strings.

Class StringUtil

Synopsis

class StringUtil {
}

Methods

public

  • endsWith() — Checks if a string ends with the given search string $strSearch.
  • indexOf() — Returns the index within the haystack of the first occurrence of the specified needle.
  • lastIndexOf() — Returns the index within the haystack of the last occurrence of the specified needle.
  • length() — Returns the length of this string.
  • matches() — Perform a global regular expression match on a given string.
  • replace() — Replaces each substring of the $strSubject that matches the given regular expression $mixedSearch with the given replacement $mixedReplace.
  • startsWith() — Checks if a string starts with the given search string $strSearch.
  • substring() — Returns a new string that is a substring of the given string.
  • toArray() — Converts a string to an array.
  • toDate() — Converts a string to a Date
  • toInt() — Converts a string to an int
  • toLowerCase() — Converts all of the characters in the given String to lower case using the rules of the default locale.
  • toUpperCase() — Converts all of the characters in the given String to upper case using the rules of the default locale.
  • trim() — Trim whitespaces (or other characters) from the beginning and end of a string.
  • truncate() — Truncates the string to a given length.