Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org

Feedback on: irt.org FAQ Knowledge Base Q1658, Thursday October 18, 2007 at 08:51:59

You are here: irt.org | About | Feedback | 5105 [ previous next ]

Feedback on:
irt.org FAQ Knowledge Base Q1658

Sent by
Carl on Thursday October 18, 2007 at 08:51:59

Worth:
Worth reading

Length:
Just right

Technical:
Just right

Comments:
Would this work better?

<script language="JavaScript"><!--
function insertNthChar(string,chr,nth) {
var output = '';
for (var i=0; i<string.length; i++) {
if (i>0 && i%nth == 0)
{
output += chr;
}
else
{
output += string.charAt(i);
}
}

return output;
}

alert(insertNthChar('erty1f213dfs1111', '-', 4));
//--></script>




Other feedback on 'irt.org FAQ Knowledge Base Q1658' - show all

©2018 Martin Webb