Remove first character of string in jquery/javascript
Posted by Raj
Remove first character of string in jquery/javascript.
In this tutorial, I will explain how to remove first character of a string in javascript.To remove the first character of a string can be easily done by javascript functions
Example:How to delete first character from a string using javascript/jQuery?
<script language="javascript" type="text/javascript">
var string = 'Hello!';
var new_string = string.substring(1);//This will only removes the first character
alert(new_string);
</script>
Example2:
<script language="javascript" type="text/javascript">
var string = 'Hello!';
alert(string.slice(1, string.length));//This will only removes the first character
</script>
In this tutorial, I will explain how to remove first character of a string in javascript.To remove the first character of a string can be easily done by javascript functions
Example:How to delete first character from a string using javascript/jQuery?
<script language="javascript" type="text/javascript">
var string = 'Hello!';
var new_string = string.substring(1);//This will only removes the first character
alert(new_string);
</script>
Example2:
<script language="javascript" type="text/javascript">
var string = 'Hello!';
alert(string.slice(1, string.length));//This will only removes the first character
</script>
This entry was posted on October 4, 2009 at 12:14 pm, and is filed under
delete first character from a string,
JAVASCRIPT,
Remove first character of string in javascript,
Remove first character of string in jquery,
removes the first character
.You can leave a response, or trackback from your own site.