codePointAt
  • 23 May 2023
  • Dark
    Light
  • PDF

codePointAt

  • Dark
    Light
  • PDF

Article summary

codePointAt Task Purpose

The codePointAt task is used to retrieve the Unicode value for a character at a specific position in a string. The result will be a non-negative integer that is the code point value of the character at the given position.

Potential Use Case

This task method helps with multilingual text and localization. Let's say you have a dataset or list that contains a unique set of language characters. To handle the characters properly and compile your data according to the Unicode standard, you would use the codePointAt task and return the code point value for each character.

Properties

Input and output parameters are shown below.

Incoming Type Description
str String Required. The string to get the Unicode value from.
pos Number The position of an element in str to return the code point value from. The pos of the first character is 0, the second character is 1, and so on.


Outgoing Type Description
codePointValue Number A number representing the code point value of the character at the given pos. If there is no character at the given pos, the task will return undefined.

Example

In this example , the incomingstr is given the Reference variable of Hello World. The pos number is "1", which equates to the letter "e" in the phrase "Hello World".

Remember, the first character position is 0, and the second character position is 1, and so on.

codePointAt-ex01

The codePointValue that returns upon output is "101", which is the Unicode value that represents the small letter "e".

codePointAt-ex02


Was this article helpful?

What's Next
Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.