switch type of string length var