diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2019-05-31 15:27:53 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2019-05-31 15:49:14 +0200 |
commit | af2c742f531e6d998c69286ad162b60b42c842c1 (patch) | |
tree | 7628dcb8538b7d8fc0adf081248e0cf6e566762f /doc/classes | |
parent | 29645c81476cb2f843f36070533281ba275f9400 (diff) |
Fix and expose String::strip_escapes(), use it in LineEdit paste
Supersedes #27736.
Diffstat (limited to 'doc/classes')
-rw-r--r-- | doc/classes/LineEdit.xml | 1 | ||||
-rw-r--r-- | doc/classes/String.xml | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml index bb180b591d..184987d2dd 100644 --- a/doc/classes/LineEdit.xml +++ b/doc/classes/LineEdit.xml @@ -166,6 +166,7 @@ </constant> <constant name="MENU_PASTE" value="2" enum="MenuItems"> Pastes the clipboard text over the selected text (or at the cursor's position). + Non-printable escape characters are automatically stripped from the OS clipboard via [method String.strip_escapes]. </constant> <constant name="MENU_CLEAR" value="3" enum="MenuItems"> Erases the whole [LineEdit] text. diff --git a/doc/classes/String.xml b/doc/classes/String.xml index e06f0738b8..5ea78c6f1c 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -741,7 +741,14 @@ <argument index="1" name="right" type="bool" default="True"> </argument> <description> - Returns a copy of the string stripped of any non-printable character at the beginning and the end. The optional arguments are used to toggle stripping on the left and right edges respectively. + Returns a copy of the string stripped of any non-printable character (including tabulations, spaces and line breaks) at the beginning and the end. The optional arguments are used to toggle stripping on the left and right edges respectively. + </description> + </method> + <method name="strip_escapes"> + <return type="String"> + </return> + <description> + Returns a copy of the string stripped of any escape character. These include all non-printable control characters of the first page of the ASCII table (< 32), such as tabulation ([code]\t[/code] in C) and newline ([code]\n[/code] and [code]\r[/code]) characters, but not spaces. </description> </method> <method name="substr"> |