purescript-strings
purescript-strings copied to clipboard
String utility functions, Char type, regular expressions.
https://www.stackage.org/haddock/lts-8.21/text-1.2.2.1/Data-Text.html#g:9 ``` justifyRight :: Int -> Char -> String -> String justifyLeft :: Int -> Char -> String -> String center :: Int -> Char -> String -> String ```...
The `dotAll` flag doesn't seem to be exposed in the Regex module. Could we add it? https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/dotAll
These functions are already present in `purescript-stringutils` but many people, especially ones coming from JavaScript, expect them to be present in the main strings library. Should I make a PR...
There is a `trim`, but no `trimStart/trimEnd` (trimLeft/trimRight). Is implementing it each time with some `countPrefix` or `regEx` should be an option?
Currently there seems to be no way to iterate over all matches including capturing groups: https://pursuit.purescript.org/packages/purescript-strings/4.0.1/docs/Data.String.Regex However, javascript has a function which lets you do just this: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/matchAll Can we...
It seems to me that these lines in `Data.String.CodePoints.uncons` https://github.com/purescript/purescript-strings/blob/157e372a23e4becd594d7e7bff6f372a6f63dd82/src/Data/String/CodePoints.purs#L197-L198 are first slicing the first code unit into a `Char` string with the JavaScript `charAt` method https://github.com/purescript/purescript-strings/blob/157e372a23e4becd594d7e7bff6f372a6f63dd82/src/Data/String/Unsafe.js#L5 and then converting...
**Description of the change** Add `startsWith` and `endsWith` functions to `Data.String.CodeUnits`. Fixes #127. I know that there's still a bit of disagreement over whether this should be done or not,...
In Javascript, the `replace` function when the first parameter is a Regex, there are special character strings for replacements, e.g. `$'`. The problem is that the PureScript `replaceAll` relies on...
**Description of the change** Clearly and concisely describe the purpose of the pull request. If this PR relates to an existing issue or change proposal, please link to it. Include...