Problem 43280. Replace x value into y value in string text.
Replace x value into y value in string text. Example text='Hello World' x='World', y='Universe' result='Hello Universe'.
Solution Stats
Problem Comments
-
2 Comments
So we can use the ans trick again ?
But we can't use something like :
function text = Replace(text,x,y)
tructruc(text,x,y)
Strange no ?
regexprep doesn't modify directly str
For example :
str='Jean'
regexprep(str,'e','a')
ans='Jaan'
but str is always = 'Jean'
Solution Comments
Show commentsProblem Recent Solvers71
Suggested Problems
-
Given an unsigned integer x, find the largest y by rearranging the bits in x
1928 Solvers
-
Back to basics 8 - Matrix Diagonals
947 Solvers
-
Compute a dot product of two vectors x and y
1020 Solvers
-
Convert given decimal number to binary number.
2209 Solvers
-
Matlab Basics - Logical Tests I
264 Solvers
More from this Author37
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!