JQuery is having split function, using this function we can able to split any text with the delimiter or regular expression. in the below example i have shown, how to split "ABC~BCA~234" string using split function in JQuery. After split function array will generate automatically, we have to use loop for displaying splitted values.
Example:
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js">
</script>
<script type="text/javascript">
$(document).ready(function() {
var text = "ABC~BCA~234";
var arrayData = text.split("~");
for (var i = 0; i < arrayData.length; i++) {
alert(arrayData[i]);
}
});
</script>
If this post useful for you, please write "Thank you" in comments"
Post a Comment
Please give your valuable feedback on this post. You can submit any ASP.NET article here. We will post that article in this website by your name.