DownloadString in C# skips newline characters -



DownloadString in C# skips newline characters -

i want import text info google finance, , utilize http address parameter downloadstring http://www.google.com/finance/getprices?i=1200&p=1d&f=d,o,h,l,c,v&df=cpct&q=aapl . however, resulting string misses newline characters, hard parse. ideas?

the line ends returned stream \n opposed default windows line ends \r\n (which represented in environment.newline on windows).

try split on of possible combinations of \r , \n:

webclient wc = new webclient(); string s = wc.downloadstring("http://www.google.com/finance/getprices?i=1200&p=1d&f=d,o,h,l,c,v&df=cpct&q=aapl"); string[] lines = s.split(new string[] { environment.newline, "\n", "\"r" }, stringsplitoptions.none);

c# downloadstring

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -