String.slice() is missing #274
Replies: 3 comments
-
Posted at 2014-05-21 by @gfwilliams I'll look into it - it looks amazingly similar to String.substring though - it seems a shame to have 3 different ways of getting substrings! For now, something like:
will probably do all you need. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-05-21 by Alex Hi Gordon, Thats true, though slice can also just have one argument. For last element in string you can do string.slice(-1). Which ofcourse you can also do with string.substring(string.lenght-1, string.length). It would be nice to have :) Regards, Alex |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-05-21 by @gfwilliams You can also use I think I can put it in and basically re-use the same code - it's just frustrating that JS has 3 functions which all do basically the same thing in subtly different ways :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2014-05-21 by Alex
Hi All,
It seems that String.slice() is missing.
http://www.w3schools.com/jsref/jsref_slice_string.asp
I was wondering if this will be implemented in espruino?
Regards,
Alex
Beta Was this translation helpful? Give feedback.
All reactions