replace()
含义:Replace a specified string in text with a specified replacement string.
Format
replace(text,str,replacement_str)
Parameters
Parameter | Definition |
text | original text |
str | text string to be found in text |
replacement_str | text string to replace str that is found in text |
Description
Use the replace() function instead of PSL common string manipulation techniques. All occurrences of str in text are replaced with replacement_str, and the result is returned.
Example
Code:
new_text=replace("Hello there","there","world");
printf("%s",new_text);
Output: