P
Peter K
Hi
I am looking for an elegant method for splitting strings with the following
format into its separate parts:
<id><language><version>
id is always 32 characters long;
language is a representation of language/locale (eg. "en" or "da-DK");
version is always a number (eg. "3" or "17" or "665");
for example:
a29b4372003c2345719de23a63725102da-DK86
a29b4372003c2345719de23a63725102en4
Obviously obtaining the first 32 characters is easy. But I need a nice way
of getting the language and version substrings. At the moment I start at
the end and work backwards until I find the first non-digit character (then
I know I have the version substring). But is there a better way?
Thanks,
Peter
I am looking for an elegant method for splitting strings with the following
format into its separate parts:
<id><language><version>
id is always 32 characters long;
language is a representation of language/locale (eg. "en" or "da-DK");
version is always a number (eg. "3" or "17" or "665");
for example:
a29b4372003c2345719de23a63725102da-DK86
a29b4372003c2345719de23a63725102en4
Obviously obtaining the first 32 characters is easy. But I need a nice way
of getting the language and version substrings. At the moment I start at
the end and work backwards until I find the first non-digit character (then
I know I have the version substring). But is there a better way?
Thanks,
Peter