ios - How to convert Alphanumeric String to NUMBER String or NUMBER? -
i want convert alphanumeric string number. alphanumeric string contains numeric digits set [0-9], capital letters set [a-z] , small letters set [a-z] respectively numbers [00-09], [10-35] , [36-62].
per single letter or digit has generate 2 digit, if letter 'y' number '61' or letter 'c' number '12' or digit '6' number '06'.
for example:
alphanumeric string: "yc69cjjvvf"
number: 61380609121945315841
create plist have manually enter data digits set [0-9], capital letters set [a-z] , small letters set [a-z].
see image below.
and create 1 loop have pass alpha bate value.and number .
nsstring *path = [[nsbundle mainbundle] pathforresource: @"yourplistname" oftype:@"plist"]; nsmutablearray *arrdata = [[nsmutablearray alloc] initwithcontentsoffile:path]; nsmutablearray *arrcode=[arrdata valueforkey:@"code"]; nsmutablearray *arrname=[arrdata valueforkey:@"name"]; nsstring *code = [[nsstring alloc] init]; (int i=0;i<[arrname count];i++) { if ([[arrname objectatindex:i] isequaltostring:straplahbates])//straplahbates string want number value. { [code appendformat:@"%@",arrcode [i]]; } }
may you.
Comments
Post a Comment