• Welcome to Valhalla Legends Archive.
 

Some Java to C# translation...

Started by Dark-Feanor, December 09, 2003, 09:59 PM

Previous topic - Next topic

Dark-Feanor

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.
- Feanor[xL]
clan exile
Firebot
iago: "caps lock is like cruise control for cool"

K

#1
BufferedReader ==> StreamReader
StringTokenizer ==> ???
InputStream ==> FileStream / Console.OpenStandardInput() depending on what you want to do.

Please excuse Bannana Schnapps imparement.

MyndFyre

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);
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

K

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.