<script src="https://code.jquery.com/jquery-1.11.3.js"></script> <script type="text/javascript"> $(document).ready(function () { //Your string var strname = "YYYYNN"; //variable to hold the result var result = ""; //Loop through each items for (var i = 0; i < strname.length; i++) { result = result + strname.charAt(i) + ","; } //output the result alert(result.slice(0, -1)); }); </script>
Thanks, A2H My Blog
alert("YYYYNN".split(''));
-- Thanks & Regards, RNA Team
Login to post response