Valhalla Legends Archive

Programming => General Programming => .NET Platform => Topic started by: Dark-Feanor on December 09, 2003, 09:59 PM

Title: Some Java to C# translation...
Post by: Dark-Feanor on December 09, 2003, 09:59 PM
I need the C# equivalents of the following java:

BufferedReader
StringTokenizer
InputStream

Working on input / output and this stuff would really help :P
Thanks for anything that you can offer.
Title: Re:Some Java to C# translation...
Post by: K on December 09, 2003, 10:59 PM
BufferedReader ==> StreamReader
StringTokenizer ==> ???
InputStream ==> FileStream / Console.OpenStandardInput() depending on what you want to do.

Please excuse Bannana Schnapps imparement.
Title: Re:Some Java to C# translation...
Post by: MyndFyre on December 10, 2003, 03:01 PM
You can tokenize a string with a single character or with an array of characters by using the following syntax:


char[] mySplittingChars = new char[] {
  ' ',
  ',',
  '.'
};

string[] tokenizedString = s_input.Split(mySplittingChars);
Title: Re:Some Java to C# translation...
Post by: K on December 10, 2003, 03:20 PM
Quote from: Myndfyre on December 10, 2003, 03:01 PM
You can tokenize a string with a single character or with an array of characters by using the following syntax:


char[] mySplittingChars = new char[] {
  ' ',
  ',',
  '.'
};

string[] tokenizedString = s_input.Split(mySplittingChars);


Ah, there you go.  I was thinking in terms of classes, so Split() didn't even cross my mind.