Upper first letter of a text input
조회 수: 10 (최근 30일)
이전 댓글 표시
Hello, I have a text input and I would like to save that text input with the first letter in uppercase and cut more than 30 letters, if necessary. What should I do? I have this:

댓글 수: 0
채택된 답변
Image Analyst
2017년 12월 6일
Try this:
lastIndex = min(30, length(new_user.name))
% Capitalize first character and lower case remaining characters.
new_user.name = [upper(new_user.name(1)), lower(new_user.name(2:lastIndex))];
댓글 수: 0
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!