I have an string "000101"
.
I know that Characters
change it to {"0","0","0","1","0","1"}
.
I want to move over this list and read its member as integer numbers. How can i do this?
Thanks a lot
I have an string "000101"
.
I know that Characters
change it to {"0","0","0","1","0","1"}
.
I want to move over this list and read its member as integer numbers. How can i do this?
Thanks a lot
v = ToExpression /@ StringSplit["000101", ""]
yields:
{0,0,0,1,0,1}
ToExpression["000101"]
yields:
101
Assuming there are only digits in a string:
ToCharacterCode["123456789"] - 48
or
"123456789" // StringCases[i : DigitCharacter :> ToExpression[i]]
or
"123456789" // Characters // ToExpression
FromDigits /@ Characters @ "000101"
{0, 0, 0, 1, 0, 1}