How To Decease The End Grapheme Of A String Using Jquery?

You tin occupation the .slice() method, its cross browser compatible.
 var id = "example1"; id.slice(-1); //Outputs: one 
Getting the concluding grapheme is easy, every moment y'all tin process strings every moment an array:
 var id = "example2"; var lastChar = id[id.length-1]; //Outputs: two 
To boot the bucket a department of a string, y'all tin occupation the substr function
 var id = "example3"; id.substr(id.length-1); //Outputs: three 

Sumber http://developer-paradize.blogspot.com

Comments

Popular posts from this blog

What Are The Main Components of a Computer System

Top Qualities To Look For In An IT Support Team

How To Integrate Google Adwords Api Into Codeigniter?