finding lower case letters

If I set x='sTring'
is there any possible way that I can detect the position of the upper case letter and add a number 'n' to it so that it'll change to letter to something else? thank you.

답변 (1개)

Daniel Shub
Daniel Shub 2011년 11월 9일

0 개 추천

x = 'aStringWithCamelCaseThatHasSomeCapitalLetters';
y = x;
z = x;
y(ismember(x, 'A':'Z')) = '?'
or
z(ismember(x, 'A':'Z')) = x(ismember(x, 'A':'Z'))+1

카테고리

도움말 센터File Exchange에서 Characters and Strings에 대해 자세히 알아보기

태그

질문:

2011년 11월 9일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by