c# - Convert Unicode string made up of culture-specific digits to integer value -


i developing program in marathi language. in it, want add/validate numbers entered in marathi unicode getting actual integer value.

for example, in marathi:

  • ४५ = 45
  • ९९ = 99

how convert marathi string "४५" actual integer value i.e. 45?

i googled lot, found nothing useful. tried using system.text.encoding.unicode.getstring() string , tried parse, failed here also.

correct way use char.getnumericvalue lets convert individual characters corresponding numeric values , construct complete value. i.e. char.getnumericvalue('९') gives 9.

depending on goal may easier replace each national digit character corresponding invariant digit , use regular parsing functions.

int32.parse("९९".replace("९", "9")) 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -