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
Jean-Marie Sainthillier
on 10 Oct 2016
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 ?
Jean-Marie Sainthillier
on 14 Oct 2016
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 Solvers67
Suggested Problems
-
Sum all integers from 1 to 2^n
15305 Solvers
-
Number of 1s in a binary string
9083 Solvers
-
368 Solvers
-
Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]
378 Solvers
-
Append two matrix as shown below example
225 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!