Arduino substring not working
Substring takes either one or two arguments.

In the single-argument version that you are using the argument specifies the start of the substring. The substring then contines to the end of the string.  So, since you are asking it to start at index 0 the returned value is the entire string - from 0 to the end.

Instead you probably want to use the two-argument version. In that version you provide two numbers - the index in the string to start from, and the index in the string after the last character you want.  So if the string starts with "print" you then want to use l1.substring(0, 5) to get the characters 0 to 4 inclusive.