If we want to remove last two characters from given string. There is an simple method in javascript, i.e substring.
var name = "hi hellow"; name.substring(0, name.length - 2);
the result is : hi hell
Note: The substring() method does not change the original string.
The actual substring syntx is
string.substring(start, end)
You might also like:
Check null values in JavaScript?04-02-2019 JavaScript null check null value |
Example for Conditional Operator in php16-04-2017 php Conditional Operator example |
How to insert bulk information into database in single query execution18-03-2017 insert sql bulk database |
How to find Angular Errors06-03-2017 errors angularjs exceptionHandler |
Call a function every second or 5 seconds in javascript22-02-2017 setinterval function calling |