Get ASCII Code from String

Is there any function that I could use to get the ASCII value of an already stored character (string)? I’m not looking to get this value via keypress, but to use a stored string variable. Or do I just need to make my own function with a switch statment for all the characters (case a: charasciicode = “blah”, case b:, etc. etc. etc.)? Thanks.