|
|
|
Change the elements of massive
|
|||
|---|---|---|---|
|
#18+
Zdravstvuyte! Pomogite pojaluista. Est dataset sostoyashiy iz nabora liniy zapolnennih bukvami. p,x,s,n,t,p,f,c,n,k,e,e,s,s,w,w,p,w,o,p,k,s,u Neobhodimo zamenit kajduyu bukvu na opredelennoe znachenie (sostoyashee iz 0 i 1) v zavisimosti ot pozicii. I tak proytis po vsem liniyam. kolichestvo simvolov v kajdoy stroke odinakovoye. Pitalas razbit dataset na linii pro pomoshi ReadLine(). Ne poymu kak obratitsia k opredelennomu simvolu v stroke. static public void ReplaceInFile(string filePath, string searchText, string replaceText) { //StreamReader reader = new StreamReader(filePath); //string content = reader.ReadToEnd(); //reader.Close(); using (StreamReader reader = File.OpenText(fileName)) { while (!reader.EndOfStream) { string line = reader.ReadLine(); int max = line.Length; int i = 0; for (i = 0; i <= max; i++) { // vot zdes ??????? } // do something with the line } } Zaranee blagodarna! ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 23.03.2011, 19:39 |
|
||
|
|

start [/forum/topic.php?fid=16&fpage=87&tid=1343048]: |
0ms |
get settings: |
5ms |
get forum list: |
10ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
36ms |
get topic data: |
6ms |
get forum data: |
1ms |
get page messages: |
20ms |
get tp. blocked users: |
1ms |
| others: | 204ms |
| total: | 289ms |

| 0 / 0 |
