Answer the question
In order to leave comments, you need to log in
How to iterate over all values of a string of a certain length consisting of numbers and letters?
Given: a string of a certain length, e.g. '03jd34' - can only consist of numbers 0..9 and Latin a..z
How to enumerate all possible values?
If there were only numbers, then the task is primitive, know yourself to increment from 0..999999, and add zeros for 0..99999 - i.e. here the alphabet is the numbers 0..9.
And when letters are added, the alphabet increases by a multiple of 0..9a..z and I don’t know how to do such an increment using the PL. And I want it that way, because there will be a sequential search from 0 to zzzzzz. Type to create some kind of data type numstring))
I wonder if it is possible, and how? Or, if not, what are the ways?
Nested loops and recursions come to mind.
Answer the question
In order to leave comments, you need to log in
Just convert numbers from 0 to 36 6 to base 36.
0 10 = 0 36
...
9 10 = 9 36
10 10 = a 36
...
35 10 = z 36
36 10 = 10 36
...
2176782335 10 = zzzzzz 36
Like something found https://stackoverflow.com/questions/12504042/what-...
Well this is how you add 1 to a number from 0..9 add 1 to a number where the digits could be 0..9 and a..z. Replace all z at the end with 0, increase the next character by 1 (if it became '9'+1, then Replace with 'a').
Element.includes('text')
Check with if(your variable.includes('characters, in the presence of which the following will be executed'){command if if will be executed}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question