Hi everyone, I have a Ti-Basic related question concerning strings. I need a String to number converter, meaning the string comprises of numbers and I want it to easily convert to an appropiate number. Here is some help to understand it.
Code:
What I did:
Code:
My way is pretty slow and not very effecient, does any one have a good optimized (fast) way? Thanks.
Code:
:"123456->Str1
:Length(Str1)->Dim(LNUM
://LNUM is a list, named NUM
:For(A,1,Length(Str1
:sub(Str1,A,1->LNUM(A
://Invalid but the point... does anyone know how to convert easily?
:End
What I did:
Code:
:"12345->Str1
:Length(Str1)->dim(LNUM
:For(A,1,Length(Str1
:sub(Str1,A,1)->Str0
:If Str0="1
:1->B
:If Str0="2
:2->B
:If Str0="3
:3->B
://etc
:B->LNUM(A
:End
My way is pretty slow and not very effecient, does any one have a good optimized (fast) way? Thanks.