Restricting the alphabet of a string



Hi,

I ve being thinking about playing around with bit strings but use in
some encoding problems I m considering and was trying to decide how to
implement a bit string class. Is there a library out there for doing
basic things with bit strings already is my first question?

I know that I can extend string to bit string, but is there anyway I
can force the alphabet to be restricted to 1's and 0's (or even 1, 0
and -1, as an extension to from trinary strings).

class Binary_String(String):
pass

Many Thanks

Nathan
.



Relevant Pages

  • Re: Restricting the alphabet of a string
    ... implement a bit string class. ... as an extension to from trinary strings). ... raise ValueError("illegal character at index " + str(i) ...
    (comp.lang.python)
  • Re: Stringbuilder vs Strings
    ... you don't exactly know how many strings you are going to concatenate. ... If you have a known number of strings, then using the concatenation ... Concat method on the string class, which is very fast (it pre-allocates the ... StringBuilder uses double capacity allocation method, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Restricting the alphabet of a string
    ... I ve being thinking about playing around with bit strings but use in ... some encoding problems I m considering and was trying to decide how to ... implement a bit string class. ... basic things with bit strings already is my first question? ...
    (comp.lang.python)
  • Re: string routines and code libraries
    ... I am also from the Delphi (and Borland C++) corner. ... But forget all you knew about strings. ... I'm still waiting for .NET to have a string class that have the ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Stringbuilder vs Strings
    ... you don't exactly know how many strings you are going to concatenate. ... Concat method on the string class, which is very fast (it pre-allocates the ... concatenations will allocate N strings for each concatenation. ... Correction: N string concatenations will allocate N strings, ...
    (microsoft.public.dotnet.languages.csharp)