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
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

Implementation of binary search: The binary search can be implemented as a recursive function. The recursive function below also implements this binary search algorithm. It re

Finding sums and products: A very general application of a for loop is to compute sums and products. For illustration, rather than of just printing the integers 1 through 5, w

Matrix Multiplication: The Matrix multiplication does not mean multiplying term by term; and it is not an array operation. The Matrix multiplication has a very particular mean

Creating the structure Variables: Creating a structure variable can be accomplished by simply storing the values in fields by using assignment statements, or by using the stru

Finding products by for loop: an illustration, when 5 is passed to be the value of the input argument n, the function will compute and return 1 + 2 + 3 + 4 + 5, or 15: >> s

Execute a exponential function program: Running the script will take up the menu as shown in the figure: Then, what happens will totally depend on which button(s) the

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

deblank function: The deblank function eliminates only trailing blanks from the string, not leading the blanks. The strtrim function will eliminate both the leading and traili

I dont know how to input different videos on matlab program