From e6dfe7b36ebfda217fe89c18b656d2eee72c18ce Mon Sep 17 00:00:00 2001 From: Olivier Hallot Date: Thu, 14 Mar 2019 06:09:37 -0300 Subject: tdf#124066, tdf#114263 BASIC Replace function Help with kind help of Gerhard Weydt (tdf#124066) Change-Id: I856c8ff600774bec82daafdef63ea8cca15b5097 Reviewed-on: https://gerrit.libreoffice.org/69255 Tested-by: Jenkins Reviewed-by: Olivier Hallot --- source/auxiliary/sbasic.tree | 1 + source/text/sbasic/shared/03120300.xhp | 1 + source/text/sbasic/shared/replace.xhp | 52 ++++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 source/text/sbasic/shared/replace.xhp (limited to 'source') diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index 5c633bcbd4..8ecb215a07 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -243,6 +243,7 @@ ReDim Statement Red Function Rem Statement + Replace Function Reset Statement Right Function RmDir Statement diff --git a/source/text/sbasic/shared/03120300.xhp b/source/text/sbasic/shared/03120300.xhp index 3d42c64853..024dbd09f6 100644 --- a/source/text/sbasic/shared/03120300.xhp +++ b/source/text/sbasic/shared/03120300.xhp @@ -40,6 +40,7 @@ + diff --git a/source/text/sbasic/shared/replace.xhp b/source/text/sbasic/shared/replace.xhp new file mode 100644 index 0000000000..ee17e0fd18 --- /dev/null +++ b/source/text/sbasic/shared/replace.xhp @@ -0,0 +1,52 @@ + + + + + + + Replace Function + /text/sbasic/shared/replace.xhp + + + +
+ + Replace function + +

Replace Function

+ Replaces some string by another. +
+ + + Replace (Text As String, SearchStr As String, ReplStr As String [, Start As Long [, Count as long [, Compare As Boolean]]] + + + String + + + 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. + 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. + + + + + + + msgbox replace ("aBbcnnbnn", "b", "$", 1, 1, FALSE) 'returns "aB$cnnbnn" + 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) + + +
-- cgit