WLJS LogoWLJS Notebook

StringPart

StringPart["string", n] gives the nth character in "string".

StringPart["string", {n1, n2, ...}] gives a list of the specified characters.

StringPart["string", m;;n] gives a list of the characters from m to n.

Examples

Get a single character:

StringPart["Hello", 2]
(* "e" *)

Get multiple characters:

StringPart["Hello", {1, 3, 5}]
(* {"H", "l", "o"} *)

Please visit the official Wolfram Language Reference for more details.

On this page