Delete Characters (Tutorial)¶
To delete characters, add the fifth line to our tutorial macro: Save the above macro and run it in a new EmEditor window. Notice that the 15 characters from
the left side
of the text editor (that is, "(tab)EmEditor is a ") are deleted. The text should now read as follows:
"EmEditor supports macros ."
"text editor."
DeleteLeftMethod deletes the specified number of characters from the left side of a string.
If text is being selected, the selected text is deleted; pressing the Backspacekey on your keyboard gives you
the same effect.
Similarly, the following methods are provided to delete characters: Delete the selected text. If no text is selected, it deletes the specified number of characters from the right side Delete the selected text. If no text is selected, it deletes the specified number of characters from the left side of a string. Equivalent to the Backspace key. You can delete words or lines by combining methods: Delete a word. document.selection.SelectWord(); Delete a word left of the cursor. document.selection.WordLeft(true); Delete a word right of the cursor. document.selection.WordRight(true); Delete a line. document.selection.SelectLine(); Delete a line left. document.selection.StartOfLine(true, eeLineLogical); Delete a line right. document.selection.EndOfLine(true, eeLineLogical); Delete an entire document. document.selection.SelectAll(); Delete a word. document.selection.SelectWord Delete a word left of the cursor. document.selection.WordLeft True Delete a word right of the cursor. document.selection.WordRight True Delete a line. document.selection.SelectLine Delete a line left. document.selection.StartOfLine True, eeLineLogical Delete a line right. document.selection.EndOfLine True, eeLineLogical Delete an entire document. document.selection.SelectAll¶
[JavaScript]¶
document.selection.Text = "EmEditor supports macros.";
document.selection.NewLine();
document.selection.Text = "\tEmEditor is a text editor.";
document.selection.CharLeft( false, 12 );
document.selection.DeleteLeft( 15 );
[VBScript]¶
document.selection.Text = "EmEditor supports macros."
document.selection.NewLine
document.selection.Text = Chr(9) & "EmEditor is a text editor."
document.selection.CharLeft False, 12
document.selection.DeleteLeft 15
of a string. Equivalent to the Delete key.[JavaScript]¶
document.selection.Delete();
document.selection.Delete();
document.selection.Delete();
document.selection.Delete();
document.selection.Delete();
document.selection.Delete();
document.selection.Delete();[VBScript]¶
document.selection.Delete
document.selection.Delete
document.selection.Delete
document.selection.Delete
document.selection.Delete
document.selection.Delete
document.selection.Delete