How am I supposed to access, let's say, the first character of every member of a string array? For example, I would like to capitalize the first letter of each word.
str = ["house", "stone", "summer"]
You can do it using conventional slicing. To get a capital of a letter I used upper
function
for i=1:size(str,2)
str{i}(1)=upper(str{i}(1))
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With