Versions Compared

Key

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


Page properties
hiddentrue
Status
Tech review

Status
titletodo

Style guide

Status
titletodo

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

Page properties
hiddentrue
Short descriptionReturns a Statussubtletruetitlestring copy of s where the first substring matching the given regular expressionregexp has been replaced with the given replacement string.Output Statussubtletruetitlestring UI Text Box
sizemedium
typeinfo

The function returns a Statussubtletruetitlestring copy of s where This function replaces the first substring matching the given given regular expressionregexp has been replaced with the given replacementstring.


Code Block
languagebash
titleSyntax
linenumberstrue
replaceFirst(string stext, string regexpregex, string replacement) #Output : StringText


UI Expand
titleExamples


Parser expressionDescription


Code Block
languagebash
linenumberstrue
replaceFirst("Hello World", "l", "_")


The function returns a

Status
subtletrue
titlestring
This example returns the following text : "He_lo World"



UI Expand
titleAdditional information

Parameters used in this function

ParameterInput (data type)Description
<parameter>text

Status
subtletrue
titledata typetext

Any given textParameter description.
<parameter>regex

Status
subtletrue
title

data typeParameter description.

text

A valid regular expression that grabs the substring to be replaced.
replacement<parameter>

Status
subtletrue
title

data type
text

This text will replace the substring found by the regexParameter description.



UI Expand
titleOutput

The This function returns a

Status
string
subtletrue
titletext


UI Text Box
typetip

If you want to replace all matching occurrences with the replacement, have a look at the replaceAll() function.

replaceFirst("Hello World", "l", "_")replaceAll("Hello World", "l", "_")
"He_lo World""He__o Wor_d"


UI Text Box
typetip

If you don't want to use a regular expression, have a look at the findReplaceFirst() function.




Image AddedUse cases and examples

Page properties report
firstcolumnUse case
headingsJWT feature, Workflow function, Field type, Automated action, Parser functions
cqllabel = "parser_func_replacefirst" and space = currentSpace()


Page properties
hiddentrue
id1


Parser function cloudreplaceFirst()
Map(tick)
Notes




Page properties
hiddentrue



Status
Tech review

Status
colourGreen
titledone

Style guide

Status
colourGreen
titledone

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



Page properties
hiddentrue


Short description

Replaces the first substring matching a given regular expression with a given replacement.

Output

Status
subtletrue
titletext

Available since

Status
subtletrue
colourRed
titleneeds lookup

Label