Replacing a string - function strrep, MATLAB in Engineering

Replacing a string - function strrep:

The function strrep finds all the occurrences of a substring within the string, and substitutes them with a new substring. The order of arguments matters. The format is as sown below:

strrep(string, oldsubstring, newsubstring)

 

The example below replaces all occurrences of the substring 'e' with the substring 'x':

>> strrep('abcdeabcde','e','x')

ans =

abcdxabcdx

 

All the strings can be of any length, and the lengths of the old and new substrings do not have to be similar.

 

Posted Date: 10/20/2012 5:33:30 AM | Location : United States







Related Discussions:- Replacing a string - function strrep, Assignment Help, Ask Question on Replacing a string - function strrep, Get Answer, Expert's Help, Replacing a string - function strrep Discussions

Write discussion on Replacing a string - function strrep
Your posts are moderated
Related Questions
Algorithm for expfn function: The algorithm for expfn function is as shown:  receives the value of x as the input argument.  Prints the value of exp(x).  assigns a

ischar function: The ischar function return the logical true if an array is a character array, or logical false if not. >> vec = 'EK127'; >> ischar(vec) ans =

Subfunctions: Though, it is possible to have more than one function in a given M-file. For illustration, if one function calls the other, the first function would be the prima

Text graphic function - Graphics objects: The text graphic function permits text to be printed in a Figure Window, involving special characters which are printed by using \spe

Matrix solutions to systems of the linear algebraic equations: The linear algebraic equation is an equation of the form a 1 x 1 + a 2 x 2 + a 3 x 3    .  .  .  .  a n x n

Finding a sting - function strfind: The function strfind does necessarily similar thing, except that the order of the arguments does make dissimilarity. The common form is str

How can I use the weighted moving average formula in matlab to smooth a column data of 404 values?

Technique is to create one element - vector: Technique is to create one element with the values from one structure, and use repmat to replicate it to the preferred size. Then,

Illustration of gauss-jordan elimination: An illustration of interchanging rows would be r1 ¬→ r3, that would results: Now, beginning with this matrix, an illustration of sc

Illustration of Preallocating a Vector: Illustration of calling the function: >> myveccumsum([5 9 4]) ans =     5  14  18 At the first time in the loop, outvec wil