TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
StringUtility Class Reference

Static Public Member Functions

static beginsWith ($haystack, $needle)
 
static endsWith ($haystack, $needle)
 
static getUniqueId ($prefix= '')
 

Detailed Description

Class with helper functions for string handling

Definition at line 20 of file StringUtility.php.

Member Function Documentation

static beginsWith (   $haystack,
  $needle 
)
static

Returns TRUE if $haystack begins with $needle. The input string is not trimmed before and search is done case sensitive.

Parameters
string$haystackFull string to check
string$needleReference string which must be found as the "first part" of the full string
Exceptions
InvalidArgumentException
Returns
bool TRUE if $needle was found to be equal to the first part of $haystack

Definition at line 31 of file StringUtility.php.

Referenced by StringUtilityTest\beginsWithReturnsFalseForNotMatchingFirstPart(), StringUtilityTest\beginsWithReturnsThrowsExceptionWithInvalidArguments(), and StringUtilityTest\beginsWithReturnsTrueForMatchingFirstPart().

static endsWith (   $haystack,
  $needle 
)
static

Returns TRUE if $haystack ends with $needle. The input string is not trimmed before and search is done case sensitive.

Parameters
string$haystackFull string to check
string$needleReference string which must be found as the "last part" of the full string
Exceptions
InvalidArgumentException
Returns
bool TRUE if $needle was found to be equal to the last part of $haystack

Definition at line 60 of file StringUtility.php.

Referenced by ContentObjectRenderer\_parseFunc(), FluidTemplateContentObject\applyStandardWrapToFluidPaths(), IconRegistry\detectIconProvider(), StringUtilityTest\endsWithReturnsFalseForNotMatchingLastPart(), StringUtilityTest\endsWithReturnsThrowsExceptionWithInvalidArguments(), StringUtilityTest\endsWithReturnsTrueForMatchingLastPart(), SystemInformationToolbarItem\getGitRevision(), and FormEngineUtility\getIconHtml().