フィルターのクリア

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

13 ビュー (過去 30 日間)
tina jain
tina jain 2015 年 5 月 12 日
コメント済み: Walter Roberson 2015 年 5 月 12 日
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 Center および File ExchangeCharacters and Strings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by