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
Function cirarea - Anonymous functions: The function handle name is cirarea. The one argument is passed to the input argument radius. The body of the function is an expression

Inverse of square matrix: The inverse is, hence the result of multiplying the scalar 1/D by each and every element in the preceding matrix. Note that this is not the matrix A,

Evaluating a string: The function eval is used to compute a string as a function. For illustration, below is the string 'plot(x)'is interpreted to be a call to plot the functi

Calling of Function polyval: The curve does not appear very smooth on this plot, but that is as there are only five points in the x vector. To estimate the temperature

Creating Cell arrays: There are many ways to create cell arrays. For illustration, we will create a cell array in which one element will store an integer, one element store ch

str2num function - String: The function str2num does the opposite; it takes the string in which a number is stored and converts it to the type double: >> num = str2num('123.

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 =

Q.1: Consider the transmission of a sinusoid x(t) = cos(2f0t) through a channel a ected by multipath and Doppler. Let there be two paths, and assume the sinusoid is being sent fro

Variable Scope: The scope of any of variable is the workspace in which it is valid. The workspace generated in the Command Window is known as the base workspace. As we know

Binary Search: The binary search supposes that the vector has been sorted first. The algorithm is just similar to the way it works whenever looking for a name in a phone direc