about strings properties issstrprop

1 visualizzazione (ultimi 30 giorni)
Umut Oskay
Umut Oskay il 20 Mag 2020
Commentato: Rik il 22 Mag 2020
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

Risposta accettata

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

Accedi per commentare.

Più risposte (1)

Walter Roberson
Walter Roberson il 20 Mag 2020
Remove the semi-colon.
isstrprop('saraaba123', 'alpha')

Categorie

Scopri di più su Characters and Strings in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by