-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcursedcode
More file actions
40 lines (36 loc) · 980 Bytes
/
Copy pathcursedcode
File metadata and controls
40 lines (36 loc) · 980 Bytes
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
/*
public string[] Resize(string[] input, int newSize)
{
string[] output = new string[newSize];
for (int i = 0; i < newSize; i++)
{
if (i < input.Length)
output[i] = input[i];
}
return output;
}
public string[] Split(string input, string token)
{
string[] output;
int size = 10;
output = new string[size];
int cursor = 0;
int index = 0;
string process = input;
index = process.IndexOf(token);
while(index > 0)
{
if (cursor >= size)
{
size *= 2;
output = Resize(output,size);
}
output[cursor] = process.Substring(0,index);
process = process.Substring(index+1);
cursor++;
index = process.IndexOf(token);
}
output = Resize(output,cursor);
return output;
}
*/