Character Acces
You can access individual characters within a string using square bracket notation. For example:
You can also use this notation to modify individual characters in a string. For example:
Keep in mind that this technique does not actually modify the original string. It just creates a new string with the modified character. To update the original string, you would need to reassign it to a new value.
Last updated