Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Page properties
hiddentrue



Status
Tech review

Status
colourGreen
titledonetodo

Style guide

colour
Status
Greentitledonetodo

Status
titletodo
Status
colourYellow
titleReady for review
Status
colourGreen
titledone
Status
colourRed
titleflagged



Page properties
hiddentrue


2.1.32
Short description

Replaces all occurrences of a given substring with the given replacement.

Output

Status
subtletrue
titletext

Available since
Status
subtletrue
colourBlue
title




UI Text Box
sizemedium
typeinfo

This function replaces all occurrences of a given substring with a given replacement.


Code Block
languagebash
titleSyntax
linenumberstrue
findReplaceAll(text, stringToBeReplaced, replacement) #Output: Text


UI Expand
titleExamples


Parser expressionDescription


Code Block
languagebash
linenumberstrue
findReplaceAll("Goodbye my love, hello my friend.", "my", "your") 


This example returns

Goodbye your love, hello your friend.


Code Block
languagebash
linenumberstrue
findReplaceAll("Jira Workflow Toolbox is a great tool!", "Jira Workflow Toolbox", "JWT") 


This example returns

JWT is a great tool!


Code Block
languagebash
linenumberstrue
findReplaceAll("The weather is beautiful!", "e", "a") 


This example returns

The waathar is baautiful!



UI Expand
titleAdditional information

Parameters used in this function

ParameterInput (data type)Description
text

Status
subtletrue
titletext

Any given text.
stringToBeReplaced

Status
subtletrue
titletext

The string that should be replaced.
replacement

Status
subtletrue
titletext

The replacement for all found substrings matching the stringToBeReplaced.



UI Expand
titleOutput

This function returns a

Status
subtletrue
titletext


UI Text Box
typetip

If you want to use a regular expression to find the substrings that should be replaced, have a look at replaceAll().

If you want of only replace the first occurence of a substring, have a look at findReplaceFirst().