Add String::replace_char(s) methods for performance and convenience
This commit is contained in:
@@ -792,6 +792,22 @@
|
||||
Replaces all occurrences of [param what] inside the string with the given [param forwhat].
|
||||
</description>
|
||||
</method>
|
||||
<method name="replace_char" qualifiers="const">
|
||||
<return type="String" />
|
||||
<param index="0" name="key" type="int" />
|
||||
<param index="1" name="with" type="int" />
|
||||
<description>
|
||||
Replaces all occurrences of the Unicode character with code [param key] with the Unicode character with code [param with]. Faster version of [method replace] when the key is only one character long. To get a single character use [code]"X".unicode_at(0)[/code] (note that some strings, like compound letters and emoji, can be made up of multiple unicode codepoints, and will not work with this method, use [method length] to make sure).
|
||||
</description>
|
||||
</method>
|
||||
<method name="replace_chars" qualifiers="const">
|
||||
<return type="String" />
|
||||
<param index="0" name="keys" type="String" />
|
||||
<param index="1" name="with" type="int" />
|
||||
<description>
|
||||
Replaces any occurrence of the characters in [param keys] with the Unicode character with code [param with]. See also [method replace_char].
|
||||
</description>
|
||||
</method>
|
||||
<method name="replacen" qualifiers="const">
|
||||
<return type="String" />
|
||||
<param index="0" name="what" type="String" />
|
||||
|
||||
Reference in New Issue
Block a user