diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 859e794399..9325e065f6 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -360,6 +360,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/compatible \ helpcontent2/source/text/sbasic/shared/enum \ helpcontent2/source/text/sbasic/shared/partition \ + helpcontent2/source/text/sbasic/shared/replace \ helpcontent2/source/text/sbasic/shared/uno_objects \ helpcontent2/source/text/sbasic/shared/stardesktop \ helpcontent2/source/text/sbasic/shared/GetPathSeparator \ 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) + + +