I wold like some help of converting an input (word or number or mix) into a single row vector, such as the following:
If input is ">DAVID123<" I want it to be as {>,D,A,V,I,D,1,2,3,<}
where all letters considered as unknown variables.
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityI wold like some help of converting an input (word or number or mix) into a single row vector, such as the following:
If input is ">DAVID123<" I want it to be as {>,D,A,V,I,D,1,2,3,<}
where all letters considered as unknown variables.
Try
ToExpression[Select[Characters[">DAVID123<" ],StringMatchQ[#,LetterCharacter]&]]
which will give you a vector of
{D,A,V,I,D}
as symbols or variables, but C
and D
and E
and I
and K
have predefined meaning inside of Mathematica and may cause you grief.
ToExpression[Characters[StringReplace[">DAVID123<",PunctuationCharacter:>"0"]]]
gives you `{0,D,A,V,I,D,1,2,3,0}
$\endgroup$