String.remove()

Description

Modify in place a String removing chars from the provided index to the end of the String or from the provided index to index plus count.

Syntax

myString.remove(index)

myString.remove(index, count)

Parameter Values

  • myString: a variable of type String.
  • index: The position at which to start the remove process (zero indexed). Allowed data types: unsigned int.
  • count: The number of characters to remove. Allowed data types: unsigned int.

Return Values

  • Nothing

Example Code

String greeting = "hello"; greeting.remove(2, 2); // greeting now contains "heo"

See Also

Please note: These are affiliate links. If you buy the components through these links, We may get a commission at no extra cost to you. We appreciate it.