Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_StringArray.c
Go to the documentation of this file.
1// typedef?
2
3class SCR_StringArray : array<string>
4{
5 //------------------------------------------------------------------------------------------------
7 int CountEmptyEntries()
8 {
9 int result;
10 for (int i = Count() - 1; i >= 0; --i)
11 {
12 if (Get(i).IsEmpty())
13 result++;
14 }
15
16 return result;
17 }
18
19 //------------------------------------------------------------------------------------------------
21 int CountEmptyOrWhiteSpaceEntries()
22 {
23 int result;
24 for (int i = Count() - 1; i >= 0; --i)
25 {
27 result++;
28 }
29
30 return result;
31 }
32
33 //------------------------------------------------------------------------------------------------
37 string Join(string separator = string.Empty, bool joinEmptyEntries = true)
38 {
39 return SCR_StringHelper.Join(separator, this, joinEmptyEntries);
40 }
41
42 //------------------------------------------------------------------------------------------------
44 bool HasEmptyEntry()
45 {
46 for (int i = Count() - 1; i >= 0; --i)
47 {
48 if (Get(i).IsEmpty())
49 return true;
50 }
51 return false;
52 }
53
54 //------------------------------------------------------------------------------------------------
56 bool HasEmptyOrWhiteSpaceEntry()
57 {
58 for (int i = Count() - 1; i >= 0; --i)
59 {
61 return true;
62 }
63 return false;
64 }
65
66 //------------------------------------------------------------------------------------------------
69 int RemoveEmptyEntries()
70 {
71 int removed;
72 for (int i = Count() - 1; i >= 0; --i)
73 {
74 if (Get(i).IsEmpty())
75 {
77 ++removed;
78 }
79 }
80
81 return removed;
82 }
83
84 //------------------------------------------------------------------------------------------------
87 int RemoveEmptyOrWhiteSpaceEntries()
88 {
89 int removed;
90 for (int i = Count() - 1; i >= 0; --i)
91 {
93 {
95 ++removed;
96 }
97 }
98
99 return removed;
100 }
101
102 //------------------------------------------------------------------------------------------------
104 void ToLower()
105 {
106 foreach (int i, string entry : this)
107 {
108 entry.ToLower();
109 Set(i, entry);
110 }
111 }
112
113 //------------------------------------------------------------------------------------------------
115 void ToUpper()
116 {
117 foreach (int i, string entry : this)
118 {
119 entry.ToUpper();
120 Set(i, entry);
121 }
122 }
123
124 //------------------------------------------------------------------------------------------------
126 void Trim()
127 {
128 foreach (int i, string entry : this)
129 {
130 entry.TrimInPlace();
131 Set(i, entry);
132 }
133 }
134}
static bool IsEmptyOrWhiteSpace(string input)
static string Join(string separator, notnull array< string > pieces, bool joinEmptyEntries=true)
proto void Set(int n, T value)
Sets n-th element to given value.
proto native void RemoveOrdered(int index)
proto native bool IsEmpty()
proto T Get(int n)
TypeID handle64 Count()