From SDU
Jump to: navigation, search
To make corrections or additions to this article, select the edit tab above.
To discuss or ask questions about this article, select the discussion tab above.


A spell function returning the string with every occurence of a given pattern replaced by another string.


<source lang="javascript"> string gsub(strSource, strRegEx, strReplacement); </source>

  • strSource - source string to be replaced
  • strRegEx - regular expression pattern
  • strReplacement - by which string should be pattern replaced


Returns changed string or the same string if pattern does not match.


  • Convert several lines to a one comma separated string

<source lang="javascript">

gsub(errorStr,"\n", ", ")