You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 30, 2019. It is now read-only.
In C# you can very handily use .TrimStart("?"), this will remove specifically a "?" if it is at the beginning. This can be incredibly useful for very common cases where you want to remove starting string characters such as dealing with query urls on the web.
JS eg:
var query = ...;
if(query.indexOf("?") === -1)
query = query.slice(1);
C# eg: var query = (...).TrimStart("?");
Not sure if this has already been considered, just been using it a lot lately in C# and thought to check if it could be used in JS.
The text was updated successfully, but these errors were encountered:
This proposal is cementing something that's already shipped in all browsers for years. It'd need to be a separate proposal. (you can also do .replace(/^?*/, ''))
In C# you can very handily use .TrimStart("?"), this will remove specifically a "?" if it is at the beginning. This can be incredibly useful for very common cases where you want to remove starting string characters such as dealing with query urls on the web.
JS eg:
C# eg:
var query = (...).TrimStart("?");
Not sure if this has already been considered, just been using it a lot lately in C# and thought to check if it could be used in JS.
The text was updated successfully, but these errors were encountered: