Implements the String prototype to be able, natively, to manipulate parameters based on text interpolation.
Hi, folks.
I believe that an implementation like this can make so much more easily to manipulate raw strings without make use of external libraries and standardize the way to make it.
Before:
N/A
After:
Index-based, Named-based and Mix-based (Single-replace)
'%0 that is too damn high. Again, %1!'.format ('Hi, Planet');
'%hiplanet that is too damn high. Again, %hiplanet!'.format ('Hi, Planet');
'%something that is too damn high. Again, %458!'.format ('Hi, Planet');
Order Desired Index-based
'%999, %000 that is too damn high. Again, %999, %000!'.format (['Hi', 'Planet']);
'%hi, %planet that is too damn high. Again, %hi, %planet!'.format (['Hi', 'Planet']);
'%some, %thing that is too damn high. Again, %some, %thing!'.format (['Hi', 'Planet']);
Object keys-based
'%hi, %planet that is too damn high. Again, %hi, %planet!'.format ({ hi: 'Hi', planet: 'Planet' });
Multiple objects keys-based
'%hi, %planet that is too damn high. Again, %hi, %planet!'.format ([{ hi: 'Hi' }, { planet: 'Planet' }]);
All above snnipets will returns
// Hi, Planet that is too damn high. Again, Hi, Planet!
It will help the others and deserves the official implementation?