You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1e5551d
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: _build/reference/790-string-replace.markdown
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
> s = REPLACE (source, pos, str [, len])
4
4
5
-
Writes the string `str` into string `source` at position `pos` and returns the new string. This function replaces `len` characters. The default value of `len` is the length of `str`.
5
+
Writes the string `str` into string `source` at position `pos` and returns the new string. This function replaces `len` characters. The default value of `len` is the length of `str`. Instead of a string, a number can be passed as a parameter. The number will be interpreted as a string.
<spanid="cb1-6"><ahref="#cb1-6" aria-hidden="true" tabindex="-1"></a><spanclass="kw">print</span><spanclass="fu">replace</span>(<spanclass="st">"abcdef"</span>, <spanclass="dv">3</span>, <spanclass="st">"1234"</span>, <spanclass="dv">1</span>) <spanclass="co">' Output: ab1234def <- only c was replaced</span></span>
61
-
<spanid="cb1-7"><ahref="#cb1-7" aria-hidden="true" tabindex="-1"></a><spanclass="kw">print</span><spanclass="fu">replace</span>(<spanclass="st">"abcdef"</span>, <spanclass="dv">3</span>, <spanclass="st">"1234"</span>, <spanclass="dv">2</span>) <spanclass="co">' Output: ab1234ef <- only cd was replaced</span></span>
<spanid="cb1-7"><ahref="#cb1-7" aria-hidden="true" tabindex="-1"></a><spanclass="kw">print</span><spanclass="fu">replace</span>(<spanclass="st">"abcdef"</span>, <spanclass="dv">3</span>, <spanclass="st">"1234"</span>, <spanclass="dv">1</span>) <spanclass="co">' Output: ab1234def <- only c was replaced</span></span>
64
+
<spanid="cb1-8"><ahref="#cb1-8" aria-hidden="true" tabindex="-1"></a><spanclass="kw">print</span><spanclass="fu">replace</span>(<spanclass="st">"abcdef"</span>, <spanclass="dv">3</span>, <spanclass="st">"1234"</span>, <spanclass="dv">2</span>) <spanclass="co">' Output: ab1234ef <- only cd was replaced</span></span>
class="sourceCode smallbasic"><codeclass="sourceCode smallbasic"><spanid="cb2-1"><ahref="#cb2-1" aria-hidden="true" tabindex="-1"></a><spanclass="dt">Const</span> TEXT = <spanclass="st">"Red Green Blue"</span><spanclass="co">' Text to replace:</span></span>
0 commit comments