about strings properties issstrprop

1 回表示 (過去 30 日間)
Umut Oskay
Umut Oskay 2020 年 5 月 20 日
コメント済み: Rik 2020 年 5 月 22 日
s= input('s: ');
isstrprop(s, 'alpha')
i wrote this code and it doesnt work. .How should i write. if i right Hello1234 as a input of s , i want to get 1 1 1 1 1 0 0 0 0 as an answer

採用された回答

Rik
Rik 2020 年 5 月 20 日
You forgot the 's' switch with your call to input:
s= input('s: ','s');
isstrprop(s, 'alpha')
  2 件のコメント
Umut Oskay
Umut Oskay 2020 年 5 月 22 日
Can you explain what is the purpose of that ‘s’
Rik
Rik 2020 年 5 月 22 日
The documentation explains it already:
str = input(prompt,'s') returns the entered text, without evaluating the input as an expression.

サインインしてコメントする。

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2020 年 5 月 20 日
Remove the semi-colon.
isstrprop('saraaba123', 'alpha')
  1 件のコメント
Umut Oskay
Umut Oskay 2020 年 5 月 20 日
sorry can you check the question again .

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAdding custom doc についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by