Peter Duniho wrote:
Well, the code uses a system of building token types and objects out of
the string. I am porting some C++ code that uses putback on the stream
during the processing which can be converted to Peek(). Your suggestion
is valid but I'm not sure it's going to work.
Of course, the Char class, how did I miss that, thanks very much.
Sound advice as usual Peter.
Why not just enumerate all the characters in the string? For example:
>
string strInput = "my string";
>
foreach (char chInput in strInput)
{
// do something with each character
}
>
Is there some specific reason you want to use StringReader?
>
string strInput = "my string";
>
foreach (char chInput in strInput)
{
// do something with each character
}
>
Is there some specific reason you want to use StringReader?
the string. I am porting some C++ code that uses putback on the stream
during the processing which can be converted to Peek(). Your suggestion
is valid but I'm not sure it's going to work.
Second, the Encoding class has _no_ methods of that nature. Why would
you expect to find an IsSpace() method in the Encoding class, when there
aren't any methods to classify characters?
>
You can, of course, call Char.IsWhiteSpa ce() on characters once you've
got a valid UTF-16 character to look at.
>
you expect to find an IsSpace() method in the Encoding class, when there
aren't any methods to classify characters?
>
You can, of course, call Char.IsWhiteSpa ce() on characters once you've
got a valid UTF-16 character to look at.
>
Sound advice as usual Peter.
Comment