- val: String value to check.
- maxlen: The maximal length of the the string or 0 if the string length doesn't matter.
- allowEmpty: Set to true if you want to allow empty strings.
- returnNoDie: Set to true if you want to return (instead of aborting the program) when an error in the input is found.
- The input string or stops the program on an error.