Find Equal value of a integer to a string

  • Thread starter Thread starter El Camino
  • Start date Start date
E

El Camino

Lets say i have :

intID=1

I need to switch that integer to 'A'

If i have intID=2 then need to switch to 'B'

If i have intID=3 then need to switch to 'C'

and so on..

Is there a quick way to that beside goiing threw and
extensive selection process
 
Microsoft.VisualBasic.Chr(1 + 64).ToString = A

Microsoft.VisualBasic.Chr(2 + 64).ToString = B

Microsoft.VisualBasic.Chr(3 + 64).ToString = C

Hope this helps.
 
* "El Camino said:
Lets say i have :

intID=1

I need to switch that integer to 'A'

If i have intID=2 then need to switch to 'B'

If i have intID=3 then need to switch to 'C'

and so on..

Is there a quick way to that beside goiing threw and
extensive selection process

You can use 'Chr(64 + intID)'.
 
It works great!
Thanks a lot
El Camino
-----Original Message-----
Microsoft.VisualBasic.Chr(1 + 64).ToString = A

Microsoft.VisualBasic.Chr(2 + 64).ToString = B

Microsoft.VisualBasic.Chr(3 + 64).ToString = C

Hope this helps.








.
 
Back
Top