Please enable JavaScript to view this site.

Knowledge Base

Navigation: Scripting Language > Functions

replacestring

We've made some changes. Use 'Ctrl-F5' to clear your browser cache.
Scroll Prev Top Next More

Replaces all the instances of a substring in a string with a new string.

 

Supported Product: FDTD, MODE, DEVICE, INTERCONNECT

 

Syntax

Description

snew = replacestring(s,s1,s2);

Replaces all instances of s1 in s with s2. If s1 is not found, the original string s is returned.

 

Example

Replace a substring in a string at all the places where it occurs.

?replacestring("test12test34","test","NEWTEST");

NEWTEST12NEWTEST34

 

See Also

Functions, length, substring, findstring, replace, str2num, num2str, splitstring, lower, upper, toscript

Copyright Lumerical Inc. | Privacy | Site Map