From 45bb570b11740cfca92aebe35ed016916c9ce2d5 Mon Sep 17 00:00:00 2001 From: Olivier Hallot Date: Fri, 24 Apr 2020 22:47:55 -0300 Subject: tdf#132390 Correction for replace() Basic function Change-Id: I7f7f0c45ad91a5614fda38b01d3d90968b835a9d Reviewed-on: https://gerrit.libreoffice.org/c/help/+/92885 Tested-by: Jenkins Reviewed-by: Olivier Hallot --- source/text/sbasic/shared/replace.xhp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/text/sbasic/shared/replace.xhp b/source/text/sbasic/shared/replace.xhp index ee17e0fd18..7f4e825f1e 100644 --- a/source/text/sbasic/shared/replace.xhp +++ b/source/text/sbasic/shared/replace.xhp @@ -25,7 +25,7 @@ - Replace (Text As String, SearchStr As String, ReplStr As String [, Start As Long [, Count as long [, Compare As Boolean]]] + Replace (Text As String, SearchStr As String, ReplStr As String [, Start As Long [, Count as Long [, Compare As Boolean]]] String @@ -34,7 +34,7 @@ Text: Any string expression that you want to modify. SearchStr: Any string expression that shall be searched for. ReplStr: Any string expression that shall replace the found search string. - Start: Numeric expression that indicates the character position within the string where the search shall begin. The maximum allowed value is 65535. + Start: Numeric expression that indicates the character position where the search starts and also the start of the substring to be returned. Count: The maximal number of times the replace shall be performed. Compare: Optional boolean expression that defines the type of comparison. The value of this parameter can be TRUE or FALSE. The default value of TRUE specifies a text comparison that is not case-sensitive. The value of FALSE specifies a binary comparison that is case-sensitive. You can as well use 0 instead of FALSE or 1 instead of TRUE. @@ -47,6 +47,8 @@ REM meaning: "b" should be replaced, but REM * only when lowercase (parameter 6), hence second occurrence of "b" REM * only first (respecting case) occurrence (parameter 5) + msgbox replace ("ABCDEFGHI", "E", "*", 4) + REM returns D*FGHI because the search starts at position 4, which is also the start of the returned string. -- cgit