how can I change a character string from low case to upper case without using the formula of 'low()' and 'upper()' ?
7 views (last 30 days)
Show older comments
Hi I´m trying to find the way of doing an algorithm in where I will need to change a character string from low case to upper case or vice versa the thing is that I dont want to to it through the formula that Matlab gives, I´m trying to do it manually without that formula, at this moment this is all the progress I have:
function outString = Revrselow(inString)
outString= '';
for idx=1:length(inString)
outString = [outString inString(idx)];
if double(inString(idx)) >= 97 && double(inString(idx)) <= 122
ret= double(inString(idx)) >= 65 && double(inString(idx)) <= 90;
end
end
end
Thanks in advance.
0 Comments
Answers (1)
Walter Roberson
on 27 Oct 2020
Subtract 32 from the character code. Which you might want to phrase as
variable - 'a' + 'A'
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!