can you please tell me how to remove any special characters from a string in MATLAB?

조회 수: 12 (최근 30일)
special characters include anything else from alphabets(a-z) and(A-Z)

답변 (1개)

Stalin Samuel
Stalin Samuel 2015년 5월 12일
%for example
s='matlab@123'
s(isletter(s)==0)=[];
  댓글 수: 2
tina jain
tina jain 2015년 5월 12일
I want to remove special characters.This is not what I want
Walter Roberson
Walter Roberson 2015년 5월 12일
It is what you defined. isletter() is true only for a-z and A-Z . If you want to leave digits alone then you need to define digits as being not "special characters"

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by