Documentation
¶
Index ¶
- Constants
- func Abs(n float64) float64
- func Ago(t time.Time) string
- func ArrayGet(data []any, key string) any
- func ArraySet(data []any, key string, value any) []any
- func Average[T int | float32 | float64](data []T) float64
- func Bytes(n int) string
- func Camel(s string) string
- func Ceil(n float64) float64
- func Chunk[T any](data []T, size int) [][]T
- func Clamp(n, minVal, maxVal float64) float64
- func Collect[T any](fns ...func() T) []T
- func Contains[T comparable](data []T, item T) bool
- func ContainsAll[T comparable](data []T, items ...T) bool
- func ContainsAny[T comparable](data []T, items ...T) bool
- func ContextChannel(ctx context.Context) string
- func ContextLocale(ctx context.Context) string
- func ContextRequestID(ctx context.Context) string
- func ContextTenantID(ctx context.Context) any
- func ContextUserID(ctx context.Context) any
- func ContextWithChannel(ctx context.Context, channel string) context.Context
- func ContextWithLocale(ctx context.Context, locale string) context.Context
- func ContextWithRequestID(ctx context.Context, requestID string) context.Context
- func ContextWithTenantID(ctx context.Context, tenantID any) context.Context
- func ContextWithUserID(ctx context.Context, userID any) context.Context
- func Currency(n float64, symbol string) string
- func Diff[T comparable](a, b []T) []T
- func DotDelete(data map[string]any, key string)
- func DotFlatten(data map[string]any) map[string]any
- func DotGet(data map[string]any, key string) any
- func DotHas(data map[string]any, key string) bool
- func DotSet(data map[string]any, key string, value any)
- func DotUnflatten(data map[string]any) map[string]any
- func Each[T any](data []T, callback func(T))
- func EachWithIndex[T any](data []T, callback func(int, T))
- func Filter[T any](data []T, predicate func(T) bool) []T
- func Flatten[T any](slices [][]T) []T
- func Floor(n float64) float64
- func GroupBy[T any](data []T, key string) map[string][]T
- func Head[T any](data []T) (T, bool)
- func Intersect[T comparable](a, b []T) []T
- func Kebab(s string) string
- func Last[T any](data []T) (T, bool)
- func LimitConcurrency(limit int, fns ...func())
- func LimitStr(s string, length int, suffix string) string
- func LimitWordsStr(s string, words int, suffix string) string
- func Map[T any, U any](data []T, mapper func(T) U) []U
- func Max[T int | float32 | float64 | string](data []T) (T, bool)
- func MaxFloat(a, b float64) float64
- func Merge[T any](slices ...[]T) []T
- func Min[T int | float32 | float64 | string](data []T) (T, bool)
- func MinFloat(a, b float64) float64
- func Number(n float64) string
- func NumberFormat(n float64, decimals int) string
- func PadLeft(s string, length int, pad string) string
- func PadRight(s string, length int, pad string) string
- func Parallel(fns ...func())
- func Percentage(n float64) string
- func Pluck[T any, U any](data []T, key string, transform func(T) U) []U
- func Plural(s string) string
- func Random(length int) string
- func RandomAlpha(length int) string
- func RandomAlphanumeric(length int) string
- func RandomNumeric(length int) string
- func Reduce[T any, U any](data []T, reducer func(U, T) U, initial U) U
- func Retry(attempts int, fn func() error) error
- func RetryWithDelay(attempts int, delayFn func(attempt int) int, fn func() error) error
- func Reverse[T any](data []T) []T
- func Round(n float64, precision int) float64
- func Shuffle[T any](data []T) []T
- func Singular(s string) string
- func Skip[T any](data []T, n int) []T
- func Slug(s string) string
- func Snake(s string) string
- func StrAfter(s, delimiter string) string
- func StrBefore(s, delimiter string) string
- func StrBetween(s, start, end string) string
- func StrContains(s, substring string) bool
- func StrEndsWith(s, suffix string) bool
- func StrIsEmpty(s string) bool
- func StrIsNotEmpty(s string) bool
- func StrJoin(parts []string, delimiter string) string
- func StrLength(s string) int
- func StrRepeat(s string, n int) string
- func StrReplace(s, search, replace string) string
- func StrReverse(s string) string
- func StrSplit(s, delimiter string) []string
- func StrStartsWith(s, prefix string) bool
- func StrToLower(s string) string
- func StrToUpper(s string) string
- func StrTrim(s string) string
- func Studly(s string) string
- func Sum[T int | float32 | float64](data []T) T
- func Tail[T any](data []T) []T
- func Take[T any](data []T, n int) []T
- func Tap[T any](value T, callback func(T)) T
- func TitleStr(s string) string
- func Unique[T comparable](data []T) []T
- func Until(t time.Time) string
- func Uuid() string
- func WordsStr(s string, words int) string
- type Carbon
- func Create(year, month, day, hour, min, sec int) *Carbon
- func CreateFromDate(year, month, day int) *Carbon
- func CreateFromTime(hour, min, sec int) *Carbon
- func Now() *Carbon
- func Parse(layout, value string) *Carbon
- func ParseDate(value string) *Carbon
- func ParseTimestamp(timestamp int64) *Carbon
- func Tomorrow() *Carbon
- func Yesterday() *Carbon
- func (c *Carbon) AddDays(days int) *Carbon
- func (c *Carbon) AddHours(hours int) *Carbon
- func (c *Carbon) AddMinutes(minutes int) *Carbon
- func (c *Carbon) AddMonths(months int) *Carbon
- func (c *Carbon) AddSeconds(seconds int) *Carbon
- func (c *Carbon) AddYears(years int) *Carbon
- func (c *Carbon) Between(start, end *Carbon) bool
- func (c *Carbon) Clamp(min, max *Carbon) *Carbon
- func (c *Carbon) Copy() *Carbon
- func (c *Carbon) DayOfWeek() int
- func (c *Carbon) DayOfYear() int
- func (c *Carbon) DaysInMonth() int
- func (c *Carbon) DaysInYear() int
- func (c *Carbon) DiffForHumans(other *Carbon) string
- func (c *Carbon) DiffInDays(other *Carbon) int
- func (c *Carbon) DiffInHours(other *Carbon) int64
- func (c *Carbon) DiffInMinutes(other *Carbon) int64
- func (c *Carbon) DiffInSeconds(other *Carbon) int64
- func (c *Carbon) EndOfDay() *Carbon
- func (c *Carbon) EndOfMonth() *Carbon
- func (c *Carbon) EndOfWeek() *Carbon
- func (c *Carbon) EndOfYear() *Carbon
- func (c *Carbon) Format(layout string) string
- func (c *Carbon) IsBirthday(other *Carbon) bool
- func (c *Carbon) IsCurrentMonth() bool
- func (c *Carbon) IsCurrentYear() bool
- func (c *Carbon) IsFuture() bool
- func (c *Carbon) IsLastMonth() bool
- func (c *Carbon) IsLastYear() bool
- func (c *Carbon) IsLeapYear() bool
- func (c *Carbon) IsNextMonth() bool
- func (c *Carbon) IsNextYear() bool
- func (c *Carbon) IsPast() bool
- func (c *Carbon) IsSameDay(other *Carbon) bool
- func (c *Carbon) IsSameMonth(other *Carbon) bool
- func (c *Carbon) IsSameYear(other *Carbon) bool
- func (c *Carbon) IsToday() bool
- func (c *Carbon) IsTomorrow() bool
- func (c *Carbon) IsWeekday() bool
- func (c *Carbon) IsWeekend() bool
- func (c *Carbon) IsYesterday() bool
- func (c *Carbon) Quarter() int
- func (c *Carbon) StartOfDay() *Carbon
- func (c *Carbon) StartOfMonth() *Carbon
- func (c *Carbon) StartOfWeek() *Carbon
- func (c *Carbon) StartOfYear() *Carbon
- func (c *Carbon) SubDays(days int) *Carbon
- func (c *Carbon) SubHours(hours int) *Carbon
- func (c *Carbon) SubMinutes(minutes int) *Carbon
- func (c *Carbon) SubMonths(months int) *Carbon
- func (c *Carbon) SubSeconds(seconds int) *Carbon
- func (c *Carbon) SubYears(years int) *Carbon
- func (c *Carbon) ToDateString() string
- func (c *Carbon) ToDateTimeString() string
- func (c *Carbon) ToDayDateTimeString() string
- func (c *Carbon) ToFormattedDateString() string
- func (c *Carbon) ToIso8601String() string
- func (c *Carbon) ToRFC3339() string
- func (c *Carbon) ToTimeString() string
- func (c *Carbon) ToTimezone(timezone string) *Carbon
- func (c *Carbon) ToUnix() int64
- func (c *Carbon) WeekOfYear() int
- type Concurrency
- type Conditionable
- type ContextPropagator
- type Defer
- type Once
- type StringHelper
- func (s *StringHelper) After(delimiter string) string
- func (s *StringHelper) AfterLast(delimiter string) string
- func (s *StringHelper) Base64Decode() (string, error)
- func (s *StringHelper) Base64Encode() string
- func (s *StringHelper) Before(delimiter string) string
- func (s *StringHelper) BeforeLast(delimiter string) string
- func (s *StringHelper) Between(start, end string) string
- func (s *StringHelper) Camel() string
- func (s *StringHelper) Contains(substring string) bool
- func (s *StringHelper) ContainsAll(substrings []string) bool
- func (s *StringHelper) EndsWith(suffix string) bool
- func (s *StringHelper) Hash() string
- func (s *StringHelper) Is(pattern string) bool
- func (s *StringHelper) IsAlpha() bool
- func (s *StringHelper) IsAlphaNumeric() bool
- func (s *StringHelper) IsEmail() bool
- func (s *StringHelper) IsEmpty() bool
- func (s *StringHelper) IsIP() bool
- func (s *StringHelper) IsJSON() bool
- func (s *StringHelper) IsNotEmpty() bool
- func (s *StringHelper) IsNumeric() bool
- func (s *StringHelper) IsURL() bool
- func (s *StringHelper) IsUUID() bool
- func (s *StringHelper) Kebab() string
- func (s *StringHelper) Length() int
- func (s *StringHelper) Limit(limit int, suffix string) string
- func (s *StringHelper) LimitWords(words int, suffix string) string
- func (s *StringHelper) Lower() string
- func (s *StringHelper) PadLeft(length int, pad string) string
- func (s *StringHelper) PadRight(length int, pad string) string
- func (s *StringHelper) Plural() string
- func (s *StringHelper) Repeat(n int) string
- func (s *StringHelper) Replace(search, replace string) string
- func (s *StringHelper) ReplaceFirst(search, replace string) string
- func (s *StringHelper) ReplaceLast(search, replace string) string
- func (s *StringHelper) Reverse() string
- func (s *StringHelper) Singular() string
- func (s *StringHelper) Slug() string
- func (s *StringHelper) Snake() string
- func (s *StringHelper) StartsWith(prefix string) bool
- func (s *StringHelper) Studly() string
- func (s *StringHelper) Title() string
- func (s *StringHelper) Upper() string
- func (s *StringHelper) Words(words int) string
- type Tappable
Constants ¶
const ( // ContextKeyRequestID is the context key for the request ID. ContextKeyRequestID contextKey = "request_id" // ContextKeyUserID is the context key for the user ID. ContextKeyUserID contextKey = "user_id" // ContextKeyTenantID is the context key for the tenant ID. ContextKeyTenantID contextKey = "tenant_id" // ContextKeyLocale is the context key for the locale. ContextKeyLocale contextKey = "locale" // ContextKeyChannel is the context key for the channel (web, api, cli, etc.). ContextKeyChannel contextKey = "channel" )
Variables ¶
This section is empty.
Functions ¶
func Collect ¶
func Collect[T any](fns ...func() T) []T
Collect collects results from concurrent operations.
func Contains ¶
func Contains[T comparable](data []T, item T) bool
Contains checks if a slice contains an item
func ContainsAll ¶
func ContainsAll[T comparable](data []T, items ...T) bool
ContainsAll checks if a slice contains all items
func ContainsAny ¶
func ContainsAny[T comparable](data []T, items ...T) bool
ContainsAny checks if a slice contains any of the items
func ContextChannel ¶
ContextChannel extracts the channel from the context.
func ContextLocale ¶
ContextLocale extracts the locale from the context.
func ContextRequestID ¶
ContextRequestID extracts the request ID from the context.
func ContextTenantID ¶
ContextTenantID extracts the tenant ID from the context.
func ContextUserID ¶
ContextUserID extracts the user ID from the context.
func ContextWithChannel ¶
ContextWithChannel adds a channel to the context.
func ContextWithLocale ¶
ContextWithLocale adds a locale to the context.
func ContextWithRequestID ¶
ContextWithRequestID adds a request ID to the context.
func ContextWithTenantID ¶
ContextWithTenantID adds a tenant ID to the context.
func ContextWithUserID ¶
ContextWithUserID adds a user ID to the context.
func Diff ¶
func Diff[T comparable](a, b []T) []T
Diff returns items in the first slice that are not in the second
func DotFlatten ¶
DotFlatten flattens a nested map using dot notation
func DotUnflatten ¶
DotUnflatten unflattens a map using dot notation
func EachWithIndex ¶
EachWithIndex iterates over a slice with index
func Intersect ¶
func Intersect[T comparable](a, b []T) []T
Intersect returns items that are in both slices
func LimitConcurrency ¶
func LimitConcurrency(limit int, fns ...func())
LimitConcurrency limits the number of concurrent operations.
func LimitWordsStr ¶
LimitWordsStr limits a string to a given number of words
func NumberFormat ¶
NumberFormat formats a number with decimal places
func Parallel ¶
func Parallel(fns ...func())
Parallel runs multiple functions concurrently and waits for all to complete.
func RandomAlpha ¶
RandomAlpha returns a random alphabetic string
func RandomAlphanumeric ¶
RandomAlphanumeric returns a random alphanumeric string
func RandomNumeric ¶
RandomNumeric returns a random numeric string
func RetryWithDelay ¶
RetryWithDelay retries a function with a specific delay between attempts.
func StrBetween ¶
StrBetween returns the substring between two delimiters
func StrContains ¶
StrContains checks if a string contains a substring
func StrEndsWith ¶
StrEndsWith checks if a string ends with a suffix
func StrIsNotEmpty ¶
StrIsNotEmpty checks if a string is not empty
func StrReplace ¶
StrReplace replaces occurrences of a substring
func StrStartsWith ¶
StrStartsWith checks if a string starts with a prefix
Types ¶
type Carbon ¶
Carbon is a fluent DateTime wrapper (Laravel Carbon equivalent).
func CreateFromDate ¶
CreateFromDate creates a Carbon from date only.
func CreateFromTime ¶
CreateFromTime creates a Carbon from time only.
func ParseTimestamp ¶
ParseTimestamp parses a Unix timestamp.
func (*Carbon) AddMinutes ¶
AddMinutes adds minutes to the date.
func (*Carbon) AddSeconds ¶
AddSeconds adds seconds to the date.
func (*Carbon) DaysInMonth ¶
DaysInMonth returns the number of days in the month.
func (*Carbon) DaysInYear ¶
DaysInYear returns the number of days in the year.
func (*Carbon) DiffForHumans ¶
DiffForHumans returns a human-readable difference (e.g., "2 hours ago").
func (*Carbon) DiffInDays ¶
DiffInDays returns the difference in days.
func (*Carbon) DiffInHours ¶
DiffInHours returns the difference in hours.
func (*Carbon) DiffInMinutes ¶
DiffInMinutes returns the difference in minutes.
func (*Carbon) DiffInSeconds ¶
DiffInSeconds returns the difference in seconds.
func (*Carbon) EndOfMonth ¶
EndOfMonth sets the day to the last day of the month.
func (*Carbon) IsBirthday ¶
IsBirthday checks if the date is the birthday (ignoring year).
func (*Carbon) IsCurrentMonth ¶
IsCurrentMonth checks if the date is in the current month.
func (*Carbon) IsCurrentYear ¶
IsCurrentYear checks if the date is the current year.
func (*Carbon) IsLastMonth ¶
IsLastMonth checks if the date is in the last month.
func (*Carbon) IsLastYear ¶
IsLastYear checks if the date is last year.
func (*Carbon) IsLeapYear ¶
IsLeapYear checks if the year is a leap year.
func (*Carbon) IsNextMonth ¶
IsNextMonth checks if the date is in the next month.
func (*Carbon) IsNextYear ¶
IsNextYear checks if the date is next year.
func (*Carbon) IsSameMonth ¶
IsSameMonth checks if two dates are the same month.
func (*Carbon) IsSameYear ¶
IsSameYear checks if two dates are the same year.
func (*Carbon) IsTomorrow ¶
IsTomorrow checks if the date is tomorrow.
func (*Carbon) IsYesterday ¶
IsYesterday checks if the date was yesterday.
func (*Carbon) StartOfDay ¶
StartOfDay sets the time to 00:00:00.
func (*Carbon) StartOfMonth ¶
StartOfMonth sets the day to 1 and time to 00:00:00.
func (*Carbon) StartOfWeek ¶
StartOfWeek sets to the start of the week (Monday).
func (*Carbon) StartOfYear ¶
StartOfYear sets to January 1, 00:00:00.
func (*Carbon) SubMinutes ¶
SubMinutes subtracts minutes from the date.
func (*Carbon) SubSeconds ¶
SubSeconds subtracts seconds from the date.
func (*Carbon) ToDateString ¶
ToDateString formats as "2006-01-02".
func (*Carbon) ToDateTimeString ¶
ToDateTimeString formats as "2006-01-02 15:04:05".
func (*Carbon) ToDayDateTimeString ¶
ToDayDateTimeString formats as "Mon, Jan 02, 2006 15:04:05".
func (*Carbon) ToFormattedDateString ¶
ToFormattedDateString formats as "Jan 02, 2006".
func (*Carbon) ToIso8601String ¶
ToIso8601String formats as ISO 8601.
func (*Carbon) ToTimeString ¶
ToTimeString formats as "15:04:05".
func (*Carbon) ToTimezone ¶
ToTimezone converts the date to a specific timezone.
func (*Carbon) WeekOfYear ¶
WeekOfYear returns the ISO week number.
type Concurrency ¶
type Concurrency struct {
// contains filtered or unexported fields
}
Concurrency provides helpers for concurrent operations.
func NewConcurrency ¶
func NewConcurrency() *Concurrency
NewConcurrency creates a new Concurrency instance.
type Conditionable ¶
type Conditionable[T any] struct { // contains filtered or unexported fields }
Conditionable provides conditional method chaining. Usage:
obj.When(condition, func(o *MyStruct) {
o.SetColor("red")
})
func NewConditionable ¶
func NewConditionable[T any](value T) *Conditionable[T]
NewConditionable creates a new Conditionable.
func (*Conditionable[T]) Unless ¶
func (c *Conditionable[T]) Unless(condition bool, callback func(T)) *Conditionable[T]
Unless executes the callback if the condition is false.
func (*Conditionable[T]) Value ¶
func (c *Conditionable[T]) Value() T
Value returns the underlying value.
func (*Conditionable[T]) When ¶
func (c *Conditionable[T]) When(condition bool, callback func(T)) *Conditionable[T]
When executes the callback if the condition is true.
type ContextPropagator ¶
type ContextPropagator struct {
// contains filtered or unexported fields
}
ContextPropagator manages context values across goroutines.
func NewContextPropagator ¶
func NewContextPropagator() *ContextPropagator
NewContextPropagator creates a new context propagator.
func (*ContextPropagator) FromContext ¶
func (cp *ContextPropagator) FromContext(ctx context.Context)
FromContext extracts values from a context into the propagator.
func (*ContextPropagator) Get ¶
func (cp *ContextPropagator) Get(key contextKey) (any, bool)
Get gets a value from the propagator.
func (*ContextPropagator) Set ¶
func (cp *ContextPropagator) Set(key contextKey, value any)
Set sets a value in the propagator.
func (*ContextPropagator) WithContext ¶
func (cp *ContextPropagator) WithContext(ctx context.Context) context.Context
WithContext creates a new context with the propagator's values.
type Defer ¶
type Defer struct {
// contains filtered or unexported fields
}
Defer provides a deferred execution helper. The callback is registered and will be executed when Flush() is called.
type Once ¶
type Once[T any] struct { // contains filtered or unexported fields }
Once provides a sync.Once-style helper for lazy initialization.
type StringHelper ¶
type StringHelper struct {
// contains filtered or unexported fields
}
StringHelper provides string manipulation helpers
func (*StringHelper) After ¶
func (s *StringHelper) After(delimiter string) string
After returns the substring after the first occurrence of a given value
func (*StringHelper) AfterLast ¶
func (s *StringHelper) AfterLast(delimiter string) string
AfterLast returns the substring after the last occurrence of a given value
func (*StringHelper) Base64Decode ¶
func (s *StringHelper) Base64Decode() (string, error)
Base64Decode decodes the string from base64
func (*StringHelper) Base64Encode ¶
func (s *StringHelper) Base64Encode() string
Base64Encode encodes the string to base64
func (*StringHelper) Before ¶
func (s *StringHelper) Before(delimiter string) string
Before returns the substring before the first occurrence of a given value
func (*StringHelper) BeforeLast ¶
func (s *StringHelper) BeforeLast(delimiter string) string
BeforeLast returns the substring before the last occurrence of a given value
func (*StringHelper) Between ¶
func (s *StringHelper) Between(start, end string) string
Between returns the substring between two delimiters
func (*StringHelper) Camel ¶
func (s *StringHelper) Camel() string
Camel converts the string to camelCase
func (*StringHelper) Contains ¶
func (s *StringHelper) Contains(substring string) bool
Contains checks if the string contains a substring
func (*StringHelper) ContainsAll ¶
func (s *StringHelper) ContainsAll(substrings []string) bool
ContainsAll checks if the string contains all substrings
func (*StringHelper) EndsWith ¶
func (s *StringHelper) EndsWith(suffix string) bool
EndsWith checks if the string ends with a substring
func (*StringHelper) Hash ¶
func (s *StringHelper) Hash() string
Hash generates a hash of the string (simple implementation)
func (*StringHelper) Is ¶
func (s *StringHelper) Is(pattern string) bool
Is checks if the string matches a pattern
func (*StringHelper) IsAlpha ¶
func (s *StringHelper) IsAlpha() bool
IsAlpha checks if the string contains only letters
func (*StringHelper) IsAlphaNumeric ¶
func (s *StringHelper) IsAlphaNumeric() bool
IsAlphaNumeric checks if the string contains only letters and numbers
func (*StringHelper) IsEmail ¶
func (s *StringHelper) IsEmail() bool
IsEmail checks if the string is an email
func (*StringHelper) IsEmpty ¶
func (s *StringHelper) IsEmpty() bool
IsEmpty checks if the string is empty
func (*StringHelper) IsIP ¶
func (s *StringHelper) IsIP() bool
IsIP checks if the string is an IP address
func (*StringHelper) IsJSON ¶
func (s *StringHelper) IsJSON() bool
IsJSON checks if the string is valid JSON
func (*StringHelper) IsNotEmpty ¶
func (s *StringHelper) IsNotEmpty() bool
IsNotEmpty checks if the string is not empty
func (*StringHelper) IsNumeric ¶
func (s *StringHelper) IsNumeric() bool
IsNumeric checks if the string is numeric
func (*StringHelper) IsURL ¶
func (s *StringHelper) IsURL() bool
IsURL checks if the string is a URL
func (*StringHelper) IsUUID ¶
func (s *StringHelper) IsUUID() bool
IsUUID checks if the string is a UUID
func (*StringHelper) Kebab ¶
func (s *StringHelper) Kebab() string
Kebab converts the string to kebab-case
func (*StringHelper) Length ¶
func (s *StringHelper) Length() int
Length returns the length of the string
func (*StringHelper) Limit ¶
func (s *StringHelper) Limit(limit int, suffix string) string
Limit limits the string to a given length
func (*StringHelper) LimitWords ¶
func (s *StringHelper) LimitWords(words int, suffix string) string
LimitWords limits the string to a given number of words
func (*StringHelper) Lower ¶
func (s *StringHelper) Lower() string
Lower converts the string to lowercase
func (*StringHelper) PadLeft ¶
func (s *StringHelper) PadLeft(length int, pad string) string
PadLeft pads the string on the left to a given length
func (*StringHelper) PadRight ¶
func (s *StringHelper) PadRight(length int, pad string) string
PadRight pads the string on the right to a given length
func (*StringHelper) Plural ¶
func (s *StringHelper) Plural() string
Plural converts the string to its plural form (simple implementation)
func (*StringHelper) Repeat ¶
func (s *StringHelper) Repeat(n int) string
Repeat repeats the string n times
func (*StringHelper) Replace ¶
func (s *StringHelper) Replace(search, replace string) string
Replace replaces occurrences of a substring
func (*StringHelper) ReplaceFirst ¶
func (s *StringHelper) ReplaceFirst(search, replace string) string
ReplaceFirst replaces the first occurrence of a substring
func (*StringHelper) ReplaceLast ¶
func (s *StringHelper) ReplaceLast(search, replace string) string
ReplaceLast replaces the last occurrence of a substring
func (*StringHelper) Singular ¶
func (s *StringHelper) Singular() string
Singular converts the string to its singular form (simple implementation)
func (*StringHelper) Snake ¶
func (s *StringHelper) Snake() string
Snake converts the string to snake_case
func (*StringHelper) StartsWith ¶
func (s *StringHelper) StartsWith(prefix string) bool
StartsWith checks if the string starts with a substring
func (*StringHelper) Studly ¶
func (s *StringHelper) Studly() string
Studly converts the string to StudlyCase
func (*StringHelper) Title ¶
func (s *StringHelper) Title() string
Title converts the string to title case
func (*StringHelper) Upper ¶
func (s *StringHelper) Upper() string
Upper converts the string to uppercase
func (*StringHelper) Words ¶
func (s *StringHelper) Words(words int) string
Words returns the first n words