I would probably just write a loop.
char [] chars = string.ToCharArray[]
for(int i=0;i<chars.Length;i++) {
yourvalue |= (chars[i] - '0') << i;
}
or with unsafe code
int length = string.Length;
fixed(char *start = string) {
while(current < length) {
yourvalue |= (chars[i] - '0') << current;
current++;
}
}
You could also use the BitVector32 class if you prefer to not deal with
shifting etc.
Cheers,
Greg Young
MVP - C#
http://geekswithblogs.net/gyoung
"Just D" <no@spam.please> wrote in message
news:Fzpfg.22845$XV5.9942@fed1read10...
All,
What's the easiest way to convert the string like 1001010101101010101 into
a binary mask of type Int64 and back? ConvertBitmask or something like
that?
Just D.