2

does Open Office BASIC support function replace(string,search string, replace with)?

MPelletier
  • 16,256
  • 15
  • 86
  • 137
tomasBULL
  • 563
  • 5
  • 10

3 Answers3

0

Yes, Open Office BASIC supports this function, but be aware it is not case sensitive.

amens
  • 125
  • 1
  • 11
0

Yes, the function is SUBSITUTE(input, search_text, replace_text[, occurrence])

Examples:

input                                         | result
----------------------------------------------+-----------------
=SUBSTITUTE("nyan cat cat","cat","nyan!")     | nyan nyan! nyan!
=SUBSTITUTE("nyan cat cat","cat","nyan!", 1)  | nyan nyan! cat
=SUBSTITUTE("nyan cat cat","cat","nyan!", 2)  | nyan cat nyan!

Here is the official documentation

bernard paulus
  • 1,644
  • 1
  • 21
  • 33
-1

Replaces part of a text string with a different text string. Syntax:

REPLACE(originaltext; startposition; length; newtext)

in originaltext, removes length characters beginning at character startposition, replaces them with newtext, and returns the result.

startposition and length must be 1 or more.

Example:

REPLACE("mouse"; 2; 3; "ic")

returns mice. Beginning at character position 2, 3 characters (ous) are removed and replaced by ic.

fancyPants
  • 50,732
  • 33
  • 89
  • 96
Arjun Upadhyay
  • 334
  • 2
  • 5