Cast arg as string in trim() and split()