beetlebug▾
/

entry delete

Deletes the characters from FIRST up to LAST.

PATHNAME delete FIRST ?LAST?

Description

Deletes the characters from the index FIRST up to the character before the index LAST. With no LAST, deletes the one character at FIRST. When LAST is not after FIRST, the text stays the same. An entry with -state disabled or readonly keeps its text.

Returns

An empty string.

Examples

% entry .de
> .de insert 0 "hello world"
> .de delete 0 6
> .de get
world

% entry .de2
> .de2 insert 0 abc
> .de2 delete 1
> .de2 get
ac

Errors

% entry .de3; .de3 delete
wrong # args: should be ".de3 delete firstIndex ?lastIndex?"
-errorcode NONE

% entry .de4; .de4 delete foo
bad entry index "foo"
-errorcode NONE

Facts

Capability
None.
Tcl release
Tcl 9.1 and 8.6.
Since
ztk 1.0.0-beta.1

See also