String

String

I need to accept a string of 8 characters and in the On User Input field action I want to add code to simply put a dash between the 4th and 5th characters.  In other words, if the string is entered or imported as ABCDEFGH then I want to convert the string in field to ABCD-EFGH.  Here's the code I added to the On User Input field action for a field named Course.

s1 = input.Course.subString(0,3);
s2 = input.Course.subString(4,7);
input.Course = s1 + "-" + s2;

This code does not work at all.  The code either has no effect on the Course field or he course field value is ABC-FGH.  This seems so straightforward but I have never been able to get this type of string handling to work in any app I've developed in ZOHO Creator.  Any help would be greatly appreciated.