You can use indexing, charAt
, or substring
to find the first character of a string in TypeScript.
index.ts311 chars12 lines
All three options should return the first character of the string, which is "h". Note that indexing is the most efficient way to get a single character from a string.
gistlibby LogSnag