title: How to split a number into individual digits in CMD/Batch
body: <p>I want to split numbers into its individual digits and store them into variables using cmd/batch on Windows. For example, the number '38' should be stored as '3' in VAR1 and '8' in VAR2.</p>
  
  <p>This is my current take on the issue:</p>
  
  <pre><code>@echo off
  SET NUMBER=38
  FOR /F "TOKENS=1,2 delims=0123456789" %%A IN ("%NUMBER%") DO (CALL :VARSET %%A %%B)
  ECHO %NUMBER% has the fallowing digits:
  ECHO 1st digit: %VAR1%
  ECHO 2nd digit: %VAR2%
  PAUSE
  EXIT /B 0
  
  :VARSET
  set VAR1=%1
  set VAR2=%2
  GOTO:EOF
  </code></pre>
  
  <p>I want the output to be:</p>
  
  <pre><code>ECHO 38 has the fallowing digits:
  ECHO 1st digit: 3
  ECHO 2nd digit: 8
  </code></pre>
  
  <p>But I get:</p>
  
  <pre><code>ECHO 38 has the fallowing digits:
  ECHO 1st digit: Echo is off.
  ECHO 2nd digit: Echo is off.
  </code></pre>
  
  <p>The problem seem to be the fact that I use '0123456789' as my delimiter. Perhaps this is not doable at all using a FOR-LOOP?</p>
  
  <p>Edit: Typos</p>