REPLACE†
Format†
REPLACE( src , before , after [ , count ] )
Function†
- Performs string substitution. All applicable pre-conversion strings are replaced.
- This operation replaces all occurrences of "before" with "after" in src.
Arguments†
- src
- The string to be converted.
- before
- The pre-conversion string.
- after
- The post-conversion string.
- count
- The number of replacements to perform (optional). Omission or a number less than or equal to zero replaces all instances.
Return value†
- If successful, the converted string
- If unsuccessful, the src string as is
Related†
- Manual/Function/RE_REPLACE
- Manual/Function/RE_REPLACEEX
Version†
- YAYA: Available from the start
- count parameter available from Tc548-1 and on
- Available in AYA5.8
Example†
_tehai = '4m4m5m5m6m6m2p3p3p4p1s1s1s'
_tsumo = '4p'
_dahai = '1s'
_tehai = REPLACE(_tehai, _dahai, _tsumo, 1)
_tehai // '4m4m5m5m6m6m2p3p3p4p4p1s1s'