by
97 7
0
3
162
0
Popular
Specified
OpenSource
Created
Modified Aug 20, 2017
No tags for this snippet yet.
Languagecsharp
Languagejavascript

Remove part of a string before specified character

Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/2519056/Remove-part-of-a-string-before-specified?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
//remove string before '&' if want to include character '&' then 'indexOf("&") + 0' var str = "black&white"; str = str.substring(str.indexOf("&") + 1); //or use regex var str = "black&white"; str = /&(.+)/.exec(str)[1]; // or use .split() and .pop() var str = "black&white"; str = str.split("&").pop();
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus