0

I have a string like given below :

4 Days :10000

I want to extract the value 10000 from this string and display it in jquery. Can anyone say how to do this ?

0

1 Answer 1

0

Use .split() or .replace() using regex in javascript

var str = "4 Days :10000";
str = str.split(':')[1];

var str1 = str.replace(/:/, "");
console.log(str1);

$('#sample').text(str);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="sample"></div>

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.