Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename string trim functions #315

Merged
merged 2 commits into from
Jun 22, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/FSharpPlus/Extensions/String.fs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module String =
let contains char (source: string) = Seq.contains char source
let toUpper (source: string) = if isNull source then source else source.ToUpperInvariant ()
let toLower (source: string) = if isNull source then source else source.ToLowerInvariant ()
let trimWhiteSpaces (source: string) = source.Trim ()
let trim (source: string) = source.Trim ()

#if !FABLE_COMPILER

Expand All @@ -53,7 +53,7 @@ module String =
let padRightWith totalLength paddingChar (source: string) = source.PadRight (totalLength, paddingChar)

/// Removes all leading and trailing occurrences of specified characters from the given string.
let trim (trimChars: char seq) (source: string) = source.Trim (Seq.toArray trimChars)
let trimBoth (trimChars: char seq) (source: string) = source.Trim (Seq.toArray trimChars)
/// Removes all leading occurrences of specified characters from the given string.
let trimStart (trimChars: char seq) (source: string) = source.TrimStart (Seq.toArray trimChars)
/// Removes all trailing occurrences of specified characters from the given string.
Expand Down Expand Up @@ -161,4 +161,4 @@ module String =
#endif

/// Converts a string to a byte-array using the specified encoding.
let getBytes (encoding: System.Text.Encoding) (source: string) : byte [] = encoding.GetBytes source
let getBytes (encoding: System.Text.Encoding) (source: string) : byte [] = encoding.GetBytes source