How to restrict a text input to letters?
3 views (last 30 days)
Show older comments
How can I restrict a text input to uppercase and lowercase letters? I have this : new_user.username = input('Username: ', 's');
0 Comments
Accepted Answer
the cyclist
on 29 Nov 2017
Edited: the cyclist
on 29 Nov 2017
new_user.username = 0;
while ~all(isletter(new_user.username))
new_user.username = input('Username: ', 's');
end
0 Comments
More Answers (0)
See Also
Categories
Find more on Characters and Strings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!