How would i get the 6th character from a string

Lets say I have this string: “code134” and I wished to get the 6th character from the string.

What I’m trying to find is a function that would return “3” since it is the 6th character, if that makes sense. Just a quick check since I forgot the way to do this and cant find any posts about it.

1 Like

What are you trying to do at a high level? Because there’s the easy answer string.sub(str, 6, 6) but I think you might be looking for a slightly more general answer

This does work but i was fairly sure that there was a function for this.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.