I have string: " 12.3 I love paris 1990".
String I want receive after remove first number is: I love paris 1990
Thank you so much.
You can do it using regular expressions as follows,
$('#regxme').text(function(i, txt) {
return txt.replace(/-?[0-9]*\.?[0-9]+/, '');
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<a href="" id="regxme"> 12.3 I love paris 1990</a>
This is the best way for your requirement:
var str = " 12.3 I love paris 1990";
str = $.trim(str)
str = str.substring(str.indexOf(' ')+1);
str = $.trim(str)
alert(str);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With