Replaces a string of characters in specified text with replacementText.
Replace(text;start;numberOfCharacters;replacementText)
text
- any text expression or text field
start
- any numeric expression or field containing a number representing the starting position in text
numberOfCharacters
- any numeric expression or field containing a number representing the number of characters to remove from text
replacementText
- any text expression or field containing the text to replace in the original string
text
FileMaker Pro 6.0 or earlier
Character replacement in text
begins at the start
character position and continues for numberOfCharacters
characters. Compare to the Substitute function.
Replace ( "1234567" ; 5 ; 1 ; "X" )
returns 1234X67.
Replace ( "1234567" ; 5 ; 1 ; "XX" )
returns 1234XX67.
Replace ( "1234567" ; 5 ; 2 ; "X" )
returns 1234X7.
Replace ( "1234567" ; 5 ; 0 ; "X" )
returns 1234X567.
Replace ( "William" ; 3 ; 4 ; "NEW TEXT" )
returns WiNEW TEXTm.
Replace ( PhoneNumber ; 1 ; 3 ; "415" )
returns 415-555-9054, when the PhoneNumber field contains 408-555-9054.