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
Referring to and Showing Cell Array Elements and Attributes: Just as with the other vectors, we can refer to individual elements of the cell arrays. The only difference is tha

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

Anonymous Functions: The anonymous function is a very easy, one-line function. The benefit of an anonymous function is that it does not have to be stored in an M-file. This ca

Algorithm for appex subfunction: The algorithm for appex subfunction is as shown:  Receives x & n as the input arguments.  Initializes a variable for running sum of t

Illustration of anonymous functions: Dissimilar functions stored in the M-files, when no argument is passed to an anonymous function, the parentheses should still be in the fu

IS Functions in Matlab: There are many functions which are built into MATLAB which test whether or not something is true; these function names start with the word is. As these

Solving 2 × 2 systems of equations: However this may be easy in a MATLAB, in normal finding solutions to the systems of equations is not. The systems which are 2 × 2 are, thou

readlenwid function: function call: [length, width] = readlenwid; function header: function [l,w] = readlenwid In the function call, not any argument is passed; henc

I have a vector of X, one for Y , one for x-direction velocity U and one for y-direction velocity V. they are at same size. How can I plot streamline of that flow? I follow all exa

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 a