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
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:7| Question number:23.7
All Answers
total answers (1)
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