Q:

Words in a string variable are separated by right slashes (/) instead of blank spaces. Write a function slashtoblank that will receive a string in this form and will return a string in which the words are separated by blank spaces

0

Words in a string variable are separated by right slashes (/) instead of blank spaces. Write a function slashtoblank that will receive a string in this form and will return a string in which the words are separated by blank spaces. This should be general and work regardless of the value of the argument. No loops allowed in this function; the built-in string function(s) must be used.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

slashToBlank.m

function outstr = slashToBlank(instr)

% Replaces slashes with blanks

% Format of call: slashToBlank(input string)

% Returns new string w/ blanks replacing /

outstr = strrep(instr,'/',' ');

end

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now