-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIO_methods.cs
44 lines (43 loc) · 1.83 KB
/
IO_methods.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PersonalRU
{
public class IO_methods
{
protected string make_single_data_string(int begin, string file_string, char separator)
{
string str = "";
int end = get_end_of_single_string(begin, file_string, separator);
if (end - begin > 0) { str = file_string.Substring(begin, end - begin);
return str; }
else return "";
}
private int get_end_of_single_string(int begin, string file_string, char separator)
{
char char_ = ' ';
while (char_ != separator)
{
char_ = file_string.ElementAt(begin);
begin++;
}
return begin-1;
}
//protected string make_single_data_string(int begin, string f_string, string separator)
//{
// bool first_simbol_condition = false;
// bool second_simbol_conditiom = false;
// char ch = ' ';
// for (int end = begin; first_simbol_condition && second_simbol_conditiom; end++)
// {
// ch = f_string.ElementAt(begin);
// if (ch == separator.ElementAt(0)) { first_simbol_condition = true; }
// if (ch != separator.ElementAt(0) && second_simbol_conditiom == false) { first_simbol_condition = false; }
// if (first_simbol_condition == true && ch == separator.ElementAt(1)) { second_simbol_conditiom = true; }
// if (first_simbol_condition == true && ch != separator.ElementAt(1)) { first_simbol_condition = false; }
// }
// return f_string.Substring(begin,get_end_of_single_string-begin);
//}
}
}