How do you get a certain character from a string?

Say you have a string,
str = "Hello World!"

How can I get only a certain character, for example character 7, which is “W” in this case?

string.sub(str,7,1)

please try reading some documentation before you ask. This is the first link in Google.

http://lua-users.org/wiki/StringLibraryTutorial

@Ignatz and @Jmv38 — Thanks.