Menu
Hi guys,
I am quite new to Javascript but enjoying what I’m doing. I was hoping some people more knowledgeable than myself could help me out with this function I’m trying to write:
function addSpaces(aString)
{
for (var i =0; i < aString.length; i = i + 1)
{
document.write(aString.charAt(i)+’ ‘);
}
}
document.write(addSpaces(‘Testing’)) ;
How do I define the last character in the string and/or disregard it when the string is displayed? Thanks in advance for your responses.