TypeScript String charAt() Method Last Updated : 19 Jul, 2024 Summarize Comments Improve Suggest changes Share Like Article Like Report The String.prototype.charAt() method in TypeScript is used to return the character at the specified index of a string. The characters in the string are indexed from left to right, starting at 0.Syntax:string.charAt( index )Parameter: This method accepts a single parameter as mentioned above and described below:index: It is an integer value between 0 and 1 less than the length of the string.Return Value: This method returns a character for the given index in the argument.Below examples illustrate the working of charAt() method in TypeScript:Examples of TypeScript String charAt() MethodExample 1: Basic Usage of charAt()In this example, we will use the charAt() method to get the character at a specific index in a string. TypeScript const str: string = "Hello, World!"; const charAtIndex: string = str.charAt(4); console.log(charAtIndex); Output:oExample 2: Iterating Over a String Using charAt()In this example, we will demonstrate how to use charAt() in a loop to access and print each character of a string. TypeScript const str: string = "JavaScript"; for (let i = 0; i < str.length; i++) { console.log(`str.charAt(${i}) is: ${str.charAt(i)}`); } Output: str.charAt(0) is:J str.charAt(1) is:a Comment More infoAdvertise with us Next Article TypeScript String charCodeAt() Method S SHUBHAMSINGH10 Follow Improve Article Tags : TypeScript Similar Reads TypeScript String charCodeAt() Method The String.charCodeAt() method in TypeScript returns the Unicode value of the character at a specified index in a string. It takes an integer index as a parameter and returns the corresponding Unicode value as a number.Syntaxstring.charCodeAt(index);Parameter: This method accepts a single parameter 2 min read TypeScript String.fromCharCode() Method The fromCharCode() is an inbuilt TypeScript String method. It mainly changes Unicode code points within the Basic Multilingual Plane (BMP) into strings. Although it provides a method for dealing with characters through typing on a keyboard it has restrictions when it comes to characters, outside the 1 min read TypeScript String codePointAt() Method The codePointAt() method is a built-in TypeScript string method. It is primarily used to retrieve the Unicode code point value of a character at a specified position within a string.Syntax:stringName.codePointAt(position);Parameters:position: This parameter requires the index position of the charact 2 min read StringBuilder charAt() in Java with Examples The charAt(int index) method of StringBuilder Class is used to return the character at the specified index of String contained by StringBuilder Object. The index value should lie between 0 and length()-1. Syntax: public char charAt(int index) Parameters: This method accepts one int type parameter in 3 min read JavaScript String charCodeAt() Method The JavaScript str.charCodeAt() method returns a Unicode character set code unit of the character present at the index in the string specified as the argument. The index number ranges from 0 to n-1, where n is the string's length.Syntax:str.charCodeAt(index)Parameters: This method accepts a single p 3 min read How to Convert a String to a Character in Java? String and char are fundamental and most commonly used datatypes in Java. A String is not a primitive data type like char. To convert a String to char in Java, we have to perform character-based operations or have to process individual characters.In this article, we will learn how to convert a Strin 3 min read Like