From 940b4d1848e8c70ab7642901a68594e8016caffc Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 18:51:28 +0200 Subject: Adding upstream version 1:7.0.4. Signed-off-by: Daniel Baumann --- helpcontent2/source/text/sbasic/shared/replace.xhp | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 helpcontent2/source/text/sbasic/shared/replace.xhp (limited to 'helpcontent2/source/text/sbasic/shared/replace.xhp') diff --git a/helpcontent2/source/text/sbasic/shared/replace.xhp b/helpcontent2/source/text/sbasic/shared/replace.xhp new file mode 100644 index 000000000..7f4e825f1 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/replace.xhp @@ -0,0 +1,54 @@ + + + + + + + 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 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. + + + + + + + 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) + 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 v1.2.3