Created
November 2, 2022 12:04
-
-
Save dburriss/0d154eed880ec234904be6192d2e8d44 to your computer and use it in GitHub Desktop.
Collection of F# string functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let isNotEmpty s = not (String.IsNullOrEmpty s) | |
let join (ss: string seq) = String.Join("", ss) | |
let lower (s: string) = s.ToLowerInvariant() | |
let trim (s: string) = s.Trim() | |
let replace (oldValue: string) newValue (s: string) = s.Replace(oldValue,newValue) | |
let split (by: string) (s: string) = s.Split(by) | |
let endsWith (tail: string) (s: string) = s.EndsWith(tail) | |
let startsWith (head: string) (s: string) = s.StartsWith(head) | |
let contains (search: string) (s: string) = s.Contains(search) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment