October\Rain\Support\Str

Overview

Str helper

Extends
  • Illuminate\Support\Str

Protected Properties

There are no protected properties in the class.

Show inherited protected properties

Inherited Protected Properties

  • $snakeCache - The cache of snake-cased words. (defined in Illuminate\Support\Str)
  • $camelCache - The cache of camel-cased words. (defined in Illuminate\Support\Str)
  • $studlyCache - The cache of studly-cased words. (defined in Illuminate\Support\Str)
  • $uuidFactory - The callback that should be used to generate UUIDs. (defined in Illuminate\Support\Str)
  • $randomStringFactory - The callback that should be used to generate random strings. (defined in Illuminate\Support\Str)
  • $macros - The registered string macros. (defined in Illuminate\Support\Str)

Public Methods

public static ascii()

public static ascii(string $value, string $language = 'en'): string 

ascii applies transliterate when the language is not found

public static getClassId()

public static getClassId($name): void

getClassId generates a class ID from either an object or a string of the class name

public static getClassNamespace()

public static getClassNamespace($name): void

getClassNamespace returns a class namespace

public static getPrecedingSymbols()

public static getPrecedingSymbols($string, $symbol): int 

getPrecedingSymbols checks if $string begins with any number of consecutive symbols, returns the number, otherwise returns 0

public static limitMiddle()

public static limitMiddle(
    string $value,
    int $limit = 100,
    string $marker = '...'
): string 

limitMiddle limits the length of a string by removing characters from the middle

public static normalizeClassName()

public static normalizeClassName($name): void

normalizeClassName removes the starting slash from a class namespace \

public static normalizeEol()

public static normalizeEol($string): void

normalizeEol converts line breaks to a standard \r\n pattern

public static ordinal()

public static ordinal(integer $number): string 

ordinal converts number to its ordinal English form

This method converts 13 to 13th, 2 to 2nd ...

public static slug()

public static slug(
    string $title,
    string $separator = '-',
    string|null $language = 'en',
    array<string, $dictionary = [ '@' => 'at']
): string 

slug adds extra sugar to convert slashes to separators

Show inherited public methods

Inherited Public Methods

  • __call() - Dynamically handle calls to the class. (defined in Illuminate\Support\Str)
  • __callStatic() - Dynamically handle calls to the class. (defined in Illuminate\Support\Str)
  • after() - Return the remainder of a string after the first occurrence of a given value. (defined in Illuminate\Support\Str)
  • afterLast() - Return the remainder of a string after the last occurrence of a given value. (defined in Illuminate\Support\Str)
  • before() - Get the portion of a string before the first occurrence of a given value. (defined in Illuminate\Support\Str)
  • beforeLast() - Get the portion of a string before the last occurrence of a given value. (defined in Illuminate\Support\Str)
  • between() - Get the portion of a string between two given values. (defined in Illuminate\Support\Str)
  • betweenFirst() - Get the smallest possible portion of a string between two given values. (defined in Illuminate\Support\Str)
  • camel() - Convert a value to camel case. (defined in Illuminate\Support\Str)
  • contains() - Determine if a given string contains a given substring. (defined in Illuminate\Support\Str)
  • containsAll() - Determine if a given string contains all array values. (defined in Illuminate\Support\Str)
  • createRandomStringsNormally() - Indicate that random strings should be created normally and not using a custom factory. (defined in Illuminate\Support\Str)
  • createRandomStringsUsing() - Set the callable that will be used to generate random strings. (defined in Illuminate\Support\Str)
  • createRandomStringsUsingSequence() - Set the sequence that will be used to generate random strings. (defined in Illuminate\Support\Str)
  • createUuidsNormally() - Indicate that UUIDs should be created normally and not using a custom factory. (defined in Illuminate\Support\Str)
  • createUuidsUsing() - Set the callable that will be used to generate UUIDs. (defined in Illuminate\Support\Str)
  • createUuidsUsingSequence() - Set the sequence that will be used to generate UUIDs. (defined in Illuminate\Support\Str)
  • endsWith() - Determine if a given string ends with a given substring. (defined in Illuminate\Support\Str)
  • excerpt() - Extracts an excerpt from text that matches the first instance of a phrase. (defined in Illuminate\Support\Str)
  • finish() - Cap a string with a single instance of a given value. (defined in Illuminate\Support\Str)
  • flushCache() - Remove all strings from the casing caches. (defined in Illuminate\Support\Str)
  • flushMacros() - Flush the existing macros. (defined in Illuminate\Support\Str)
  • freezeUuids() - Always return the same UUID when generating new UUIDs. (defined in Illuminate\Support\Str)
  • hasMacro() - Checks if macro is registered. (defined in Illuminate\Support\Str)
  • headline() - Convert the given string to title case for each word. (defined in Illuminate\Support\Str)
  • inlineMarkdown() - Converts inline Markdown into HTML. (defined in Illuminate\Support\Str)
  • is() - Determine if a given string matches a given pattern. (defined in Illuminate\Support\Str)
  • isAscii() - Determine if a given string is 7 bit ASCII. (defined in Illuminate\Support\Str)
  • isJson() - Determine if a given string is valid JSON. (defined in Illuminate\Support\Str)
  • isUlid() - Determine if a given string is a valid ULID. (defined in Illuminate\Support\Str)
  • isUuid() - Determine if a given string is a valid UUID. (defined in Illuminate\Support\Str)
  • kebab() - Convert a string to kebab case. (defined in Illuminate\Support\Str)
  • lcfirst() - Make a string's first character lowercase. (defined in Illuminate\Support\Str)
  • length() - Return the length of the given string. (defined in Illuminate\Support\Str)
  • limit() - Limit the number of characters in a string. (defined in Illuminate\Support\Str)
  • lower() - Convert the given string to lower-case. (defined in Illuminate\Support\Str)
  • macro() - Register a custom macro. (defined in Illuminate\Support\Str)
  • markdown() - Converts GitHub flavored Markdown into HTML. (defined in Illuminate\Support\Str)
  • mask() - Masks a portion of a string with a repeated character. (defined in Illuminate\Support\Str)
  • match() - Get the string matching the given pattern. (defined in Illuminate\Support\Str)
  • matchAll() - Get the string matching the given pattern. (defined in Illuminate\Support\Str)
  • mixin() - Mix another object into the class. (defined in Illuminate\Support\Str)
  • of() - Get a new stringable object from the given string. (defined in Illuminate\Support\Str)
  • orderedUuid() - Generate a time-ordered UUID (version 4). (defined in Illuminate\Support\Str)
  • padBoth() - Pad both sides of a string with another. (defined in Illuminate\Support\Str)
  • padLeft() - Pad the left side of a string with another. (defined in Illuminate\Support\Str)
  • padRight() - Pad the right side of a string with another. (defined in Illuminate\Support\Str)
  • parseCallback() - Parse a Class[@]method style callback into class and method. (defined in Illuminate\Support\Str)
  • plural() - Get the plural form of an English word. (defined in Illuminate\Support\Str)
  • pluralStudly() - Pluralize the last word of an English, studly caps case string. (defined in Illuminate\Support\Str)
  • random() - Generate a more truly "random" alpha-numeric string. (defined in Illuminate\Support\Str)
  • remove() - Remove any occurrence of the given string in the subject. (defined in Illuminate\Support\Str)
  • repeat() - Repeat the given string. (defined in Illuminate\Support\Str)
  • replace() - Replace the given value in the given string. (defined in Illuminate\Support\Str)
  • replaceArray() - Replace a given value in the string sequentially with an array. (defined in Illuminate\Support\Str)
  • replaceFirst() - Replace the first occurrence of a given value in the string. (defined in Illuminate\Support\Str)
  • replaceLast() - Replace the last occurrence of a given value in the string. (defined in Illuminate\Support\Str)
  • reverse() - Reverse the given string. (defined in Illuminate\Support\Str)
  • singular() - Get the singular form of an English word. (defined in Illuminate\Support\Str)
  • snake() - Convert a string to snake case. (defined in Illuminate\Support\Str)
  • squish() - Remove all "extra" blank space from the given string. (defined in Illuminate\Support\Str)
  • start() - Begin a string with a single instance of a given value. (defined in Illuminate\Support\Str)
  • startsWith() - Determine if a given string starts with a given substring. (defined in Illuminate\Support\Str)
  • studly() - Convert a value to studly caps case. (defined in Illuminate\Support\Str)
  • substr() - Returns the portion of the string specified by the start and length parameters. (defined in Illuminate\Support\Str)
  • substrCount() - Returns the number of substring occurrences. (defined in Illuminate\Support\Str)
  • substrReplace() - Replace text within a portion of a string. (defined in Illuminate\Support\Str)
  • swap() - Swap multiple keywords in a string with other keywords. (defined in Illuminate\Support\Str)
  • title() - Convert the given string to title case. (defined in Illuminate\Support\Str)
  • transliterate() - Transliterate a string to its closest ASCII representation. (defined in Illuminate\Support\Str)
  • ucfirst() - Make a string's first character uppercase. (defined in Illuminate\Support\Str)
  • ucsplit() - Split a string into pieces by uppercase characters. (defined in Illuminate\Support\Str)
  • ulid() - Generate a ULID. (defined in Illuminate\Support\Str)
  • upper() - Convert the given string to upper-case. (defined in Illuminate\Support\Str)
  • uuid() - Generate a UUID (version 4). (defined in Illuminate\Support\Str)
  • wordCount() - Get the number of words a string contains. (defined in Illuminate\Support\Str)
  • words() - Limit the number of words in a string. (defined in Illuminate\Support\Str)
  • wrap() - Wrap the string with the given strings. (defined in Illuminate\Support\Str)