str

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2022 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ASCII

func ASCII()

ASCII The ASCII method will attempt to transliterate the string into an ASCII value

func After

func After()

After The After method returns everything after the given value in a string

func AfterLast

func AfterLast()

AfterLast The AfterLast method returns everything after the last occurrence of the given value in a string

func BaseName

func BaseName()

BaseName The BaseName method will return the trailing name component of the given string

func Before

func Before()

Before The Before method returns everything before the given value in a string

func BeforeLast

func BeforeLast()

BeforeLast The BeforeLast method returns everything before the last occurrence of the given value in a string

func Between

func Between()

Between The Between method returns the portion of a string between two values

func Bind

func Bind(input string, data interface{}) string

Bind apply data to the given template

func Camel

func Camel()

Camel The Camel method converts the given string to camelCase

func Contains

func Contains()

Contains The Contains method determines if the given string contains the given value. This method is case sensitive

func ContainsAll

func ContainsAll()

ContainsAll The ContainsAll method determines if the given string contains all of the values in a given array

func DirName

func DirName()

DirName The DirName method returns the parent directory portion of the given string

func EndsWith

func EndsWith()

EndsWith The EndsWith method determines if the given string ends with the given value

func Exactly

func Exactly()

Exactly The Exactly method determines if the given string is an exact match with another string

func Explode

func Explode()

Explode The Explode method splits the string by the given delimiter and returns a collection containing each section of the split string:

func Finish

func Finish()

Finish The Finish method adds a single instance of the given value to a string if it does not already end with that value

func Is

func Is()

Is The Is method determines if a given string matches a given pattern. Asterisks may be used as wildcard values

func IsASCII

func IsASCII()

IsASCII The IsASCII method determines if a given string is 7 bit ASCII

func IsUUID

func IsUUID()

IsUUID The IsUUID method determines if the given string is a valid UUID

func Kebab

func Kebab()

Kebab The Kebab method converts the given string to kebab-case

func Length

func Length(s string) int

Length The Length method returns the length of the given string

func Limit

func Limit()

Limit The limit method truncates the given string to the specified length

func Lower

func Lower()

Lower The Lower method converts the given string to lowercase

func Ltrim

func Ltrim()

Ltrim The Ltrim method trims the left side of the string

func Markdown

func Markdown()

Markdown The Markdown method converts GitHub flavored Markdown into HTML

func Match

func Match()

Match The Match method will return the portion of a string that matches a given regular expression pattern

func MatchAll

func MatchAll()

MatchAll The MatchAll method will return a collection containing the portions of a string that match a given regular expression pattern

func OrderedUUID

func OrderedUUID()

OrderedUUID The OrderedUUID method generates a "timestamp first" UUID that may be efficiently stored in an indexed database column. Each UUID that is generated using this method will be sorted after UUIDs previously generated using the method

func PadBoth

func PadBoth()

PadBoth The PadBoth method padding both sides of a string with another string until the final string reaches a desired length

func PadLeft

func PadLeft()

PadLeft The PadLeft method padding the left side of a string with another string until the final string reaches a desired length

func PadRight

func PadRight()

PadRight The PadRight method padding the right side of a string with another string until the final string reaches a desired length

func Pipe

func Pipe()

Pipe The pipe method allows you to transform the string by passing its current value to the given callable

func Prepend

func Prepend()

Prepend The Prepend method prepends the given values onto the string

func Random

func Random()

Random The Random method generates a random string of the specified length.

func Remove

func Remove()

Remove The Remove method removes the given value or array of values from the string:

func Replace

func Replace(s string, old string, new string, n int) string

Replace The Replace method replaces a given string within the string:

func ReplaceArray

func ReplaceArray()

ReplaceArray The ReplaceArray method replaces a given value in the string sequentially using an array

func ReplaceFirst

func ReplaceFirst()

ReplaceFirst The ReplaceFirst method replaces the first occurrence of a given value in a string

func ReplaceLast

func ReplaceLast()

ReplaceLast The ReplaceLast method replaces the last occurrence of a given value in a string

func ReplaceMatches

func ReplaceMatches()

ReplaceMatches The replaceMatches method replaces all portions of a string matching a pattern with the given replacement string:

func Rtrim

func Rtrim()

Rtrim The Rtrim method trims the right side of the given string

func Slug

func Slug()

Slug The Slug method generates a URL friendly "slug" from the given string

func Snake

func Snake(str string) string

Snake The Snake method converts the given string to snake_case

func Split

func Split()

Split The Split method splits a string into a collection using a regular expression

func Start

func Start()

Start The Start method adds a single instance of the given value to a string if it does not already start with that value

func StartsWith

func StartsWith()

StartsWith The StartsWith method determines if the given string begins with the given value

func Studly

func Studly()

Studly The Studly method converts the given string to StudlyCase

func Substr

func Substr()

Substr The Substr method returns the portion of string specified by the start and length parameters

func SubstrCount

func SubstrCount()

SubstrCount The Str::substrCount method returns the number of occurrences of a given value in the given string

func Tap

func Tap()

Tap The Tap method passes the string to the given closure, allowing you to examine and interact with the string while not affecting the string itself. The original string is returned by the tap method regardless of what is returned by the closure

func Test

func Test()

Test The Test method determines if a string matches the given regular expression pattern

func Title

func Title()

Title The Title method converts the given string to Title Case

func Trim

func Trim()

Trim The Trim method trims the given string

func UUID

func UUID()

UUID The UUID method generates a UUID (version 4)

func Ucfirst

func Ucfirst()

Ucfirst The Str::Ucfirst method returns the given string with the first character capitalized

func Upper

func Upper()

Upper The Upper method converts the given string to uppercase

func WordCount

func WordCount()

WordCount The WordCount function returns the number of words that a string contains

func Words

func Words()

Words The Words method limits the number of words in a string. An additional string may be passed to this method via its third argument to specify which string should be appended to the end of the truncated string

Types

type String

type String string

String type of string

func Of

func Of(value interface{}) String

Of make a new string

func (String) ASCII

func (s String) ASCII()

ASCII The ASCII method will attempt to transliterate the string into an ASCII value

func (String) After

func (s String) After()

After The After method returns everything after the given value in a string

func (String) AfterLast

func (s String) AfterLast()

AfterLast The AfterLast method returns everything after the last occurrence of the given value in a string

func (String) Append

func (s String) Append()

Append The Append method appends the given values to the string

func (String) BaseName

func (s String) BaseName()

BaseName The BaseName method will return the trailing name component of the given string

func (String) Before

func (s String) Before()

Before The Before method returns everything before the given value in a string

func (String) BeforeLast

func (s String) BeforeLast()

BeforeLast The BeforeLast method returns everything before the last occurrence of the given value in a string

func (String) Between

func (s String) Between()

Between The Between method returns the portion of a string between two values

func (String) Bind

func (s String) Bind(data interface{}) string

Bind apply data to the given template

func (String) Camel

func (s String) Camel()

Camel The Camel method converts the given string to camelCase

func (String) Contains

func (s String) Contains()

Contains The Contains method determines if the given string contains the given value. This method is case sensitive

func (String) ContainsAll

func (s String) ContainsAll()

ContainsAll The ContainsAll method determines if the given string contains all of the values in a given array

func (String) DirName

func (s String) DirName()

DirName The DirName method returns the parent directory portion of the given string

func (String) EndsWith

func (s String) EndsWith()

EndsWith The EndsWith method determines if the given string ends with the given value

func (String) Exactly

func (s String) Exactly()

Exactly The Exactly method determines if the given string is an exact match with another string

func (String) Explode

func (s String) Explode()

Explode The Explode method splits the string by the given delimiter and returns a collection containing each section of the split string:

func (String) Finish

func (s String) Finish()

Finish The Finish method adds a single instance of the given value to a string if it does not already end with that value

func (String) Is

func (s String) Is()

Is The Is method determines if a given string matches a given pattern. Asterisks may be used as wildcard values

func (String) IsASCII

func (s String) IsASCII()

IsASCII The IsASCII method determines if a given string is 7 bit ASCII

func (String) IsEmpty

func (s String) IsEmpty()

IsEmpty The isEmpty method determines if the given string is empty

func (String) IsNotEmpty

func (s String) IsNotEmpty()

IsNotEmpty The IsNotEmpty method determines if the given string is not empty

func (String) IsUUID

func (s String) IsUUID()

IsUUID The IsUUID method determines if the given string is a valid UUID

func (String) Kebab

func (s String) Kebab()

Kebab The Kebab method converts the given string to kebab-case

func (String) Length

func (s String) Length() int

Length The Length method returns the length of the given string

func (String) Limit

func (s String) Limit()

Limit The limit method truncates the given string to the specified length

func (String) Lower

func (s String) Lower()

Lower The Lower method converts the given string to lowercase

func (String) Ltrim

func (s String) Ltrim()

Ltrim The Ltrim method trims the left side of the string

func (String) Markdown

func (s String) Markdown()

Markdown The Markdown method converts GitHub flavored Markdown into HTML

func (*String) MarshalJSON

func (s *String) MarshalJSON() ([]byte, error)

MarshalJSON for json MarshalJSON

func (String) Match

func (s String) Match()

Match The Match method will return the portion of a string that matches a given regular expression pattern

func (String) MatchAll

func (s String) MatchAll()

MatchAll The MatchAll method will return a collection containing the portions of a string that match a given regular expression pattern

func (String) PadBoth

func (s String) PadBoth()

PadBoth The PadBoth method padding both sides of a string with another string until the final string reaches a desired length

func (String) PadLeft

func (s String) PadLeft()

PadLeft The PadLeft method padding the left side of a string with another string until the final string reaches a desired length

func (String) PadRight

func (s String) PadRight()

PadRight The PadRight method padding the right side of a string with another string until the final string reaches a desired length

func (String) Pipe

func (s String) Pipe()

Pipe The pipe method allows you to transform the string by passing its current value to the given callable

func (String) Prepend

func (s String) Prepend()

Prepend The Prepend method prepends the given values onto the string

func (String) Remove

func (s String) Remove()

Remove The Remove method removes the given value or array of values from the string:

func (String) Replace

func (s String) Replace(old string, new string, n int) string

Replace The Replace method replaces a given string within the string:

func (String) ReplaceArray

func (s String) ReplaceArray()

ReplaceArray The ReplaceArray method replaces a given value in the string sequentially using an array

func (String) ReplaceFirst

func (s String) ReplaceFirst()

ReplaceFirst The ReplaceFirst method replaces the first occurrence of a given value in a string

func (String) ReplaceLast

func (s String) ReplaceLast()

ReplaceLast The ReplaceLast method replaces the last occurrence of a given value in a string

func (String) ReplaceMatches

func (s String) ReplaceMatches()

ReplaceMatches The replaceMatches method replaces all portions of a string matching a pattern with the given replacement string:

func (String) Rtrim

func (s String) Rtrim()

Rtrim The Rtrim method trims the right side of the given string

func (*String) Scan

func (s *String) Scan(src interface{}) error

Scan for db scan

func (String) Slug

func (s String) Slug()

Slug The Slug method generates a URL friendly "slug" from the given string

func (String) Snake

func (s String) Snake() string

Snake The Snake method converts the given string to snake_case

func (String) Split

func (s String) Split()

Split The Split method splits a string into a collection using a regular expression

func (String) Start

func (s String) Start()

Start The Start method adds a single instance of the given value to a string if it does not already start with that value

func (String) StartsWith

func (s String) StartsWith()

StartsWith The StartsWith method determines if the given string begins with the given value

func (String) Studly

func (s String) Studly()

Studly The Studly method converts the given string to StudlyCase

func (String) Substr

func (s String) Substr()

Substr The Substr method returns the portion of string specified by the start and length parameters

func (String) Tap

func (s String) Tap()

Tap The Tap method passes the string to the given closure, allowing you to examine and interact with the string while not affecting the string itself. The original string is returned by the tap method regardless of what is returned by the closure

func (String) Test

func (s String) Test()

Test The Test method determines if a string matches the given regular expression pattern

func (String) Title

func (s String) Title()

Title The Title method converts the given string to Title Case

func (String) Trim

func (s String) Trim()

Trim The Trim method trims the given string

func (String) Ucfirst

func (s String) Ucfirst()

Ucfirst The Str::Ucfirst method returns the given string with the first character capitalized

func (*String) UnmarshalJSON

func (s *String) UnmarshalJSON(data []byte) error

UnmarshalJSON for json UnmarshalJSON

func (String) Upper

func (s String) Upper()

Upper The Upper method converts the given string to uppercase

func (*String) Value

func (s *String) Value() (driver.Value, error)

Value for db driver value

func (String) When

func (s String) When()

When The When method invokes the given closure if a given condition is true. The closure will receive the fluent string instance

func (String) WhenEmpty

func (s String) WhenEmpty()

WhenEmpty The WhenEmpty method invokes the given closure if the string is empty. If the closure returns a value, that value will also be returned by the whenEmpty method. If the closure does not return a value, the fluent string instance will be returned

func (String) WordCount

func (s String) WordCount()

WordCount The WordCount function returns the number of words that a string contains

func (String) Words

func (s String) Words()

Words The Words method limits the number of words in a string. An additional string may be passed to this method via its third argument to specify which string should be appended to the end of the truncated string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL