Hi,
My code so far is:
Str=input('Give a string: '); ind=find(Str==' '); num_words=size(ind,2)+1; disp('Number of blank spaces:') disp(length(ind)) disp('Number of words in the string:') disp(num_words)
I wanted to know how to display the first and last word from the string entered, any suggestions are appreciated 🙂
Best Answer