Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let mockSuffixesToDrop = ["a";"b"];
- let shouldNormalize = true;
- let clearSuffix (input:string) (suffix:string) =
- match (input:string) with
- | input when input.EndsWith(suffix) -> input.[0..(input.Length-suffix.Length)]
- | _ -> input
- let clearSuffixes suffixesToDrop input =
- List.fold clearSuffix input suffixesToDrop
- let normalizeSlashes (input:string) =
- input.Replace ('/', '\\')
- let processString input:string =
- match shouldNormalize with
- | true -> normalizeSlashes input |> clearSuffixes mockSuffixesToDrop
- | false -> clearSuffixes mockSuffixesToDrop input
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement