Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

Phone API Reference - UI Classes (Widgets) - Input - replace

replace

Description

Replaces a range of text from the input widget with another string.

Basic Example: 

 textObj.replace(begin, end, replacement);

Note, this will focus the cursor at the end of the replacement.

Parameters

Name

Required

Type

Default

Description

begin

Yes

integer

Index to begin replacing.

end

Yes

integer

Index to end replacing.

replacement

Yes

string

The string to use as the replacement.

Examples

replace bar with foo

var input = new Input(0, 0, 100, Text.LINE_HEIGHT);
input.value = 'FooBar';
input.replace(3, 5, 'Foo')
return input.toString();  //returns 'FooFoo'

  • No labels