trimCharsStart
See original GitHub issueIs your feature request related to a problem? Please describe. Removes leading specified characters from string.
Describe the solution you’d like
RA.trimCharsStart('_-', '-_-abc-_-'); //=> 'abc-_-'
Additional context
Function should be curried. Related to trimStart/trimEnd issue.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
trimCharsStart.js - Documentation
* Removes specified characters from the beginning of a string. *; * @func trimCharsStart; * @memberOf RA ...
Read more >trimCharsStart.js | searchcode
searchcode is a free source code search engine. Code snippets and open source (free sofware) repositories are indexed and searchable.
Read more >trimStart/trimEnd · Issue #808 · char0n/ramda-adjunct - GitHub
I've create another related function trimCharsStart and trimCharsEnd. All reactions.
Read more >Alex (@js636f) / Twitter
The release contains one single community contributed function `trimCharsStart`. Read more in attached release article #javascript ...
Read more >Index of /resources/responsive-static ... - The Northern Echo
Index of /resources/responsive-static/node_modules/@babel/traverse/node_modules/lodash/fp · Parent Directory · F.js · T.js · __.js · _baseConvert.js · _convertBrowser ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Take a look at lodash.trimStart. We need exactly the same behavior. In our case the first argument are the characters in form of string that are replacing the characters at the beginning of a value. So our arguments are
Now how should it work ? We decompose the
value
into list of characters calledvalueCharList
with the following constructvalueCharList = [...value]
. We then iterate this list of characters and checking if the current character is contained withinchars
string. If yes, then we shift thevalueCharList
. We repeat iteration until there is match inchars
. If there is not match we returnvalueCharList.join('')
. And that should be the algorithm.@char0n can i take this