This page is also available in 3 other languages

remove()

[StringObject Function]

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)

Parameters

myString: a variable of type String

index: a variable of type unsigned int

count: a variable of type unsigned int

Returns

None

Example Code

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

See also