Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Normalize()

string MS.Internal.Xml.XPath.StringFunctions.Normalize ( XPathNodeIterator nodeIterator)
inlineprivate

Definition at line 233 of file StringFunctions.cs.

234 {
235 string text = ((_argList.Count <= 0) ? nodeIterator.Current.Value : _argList[0].Evaluate(nodeIterator).ToString());
236 int num = -1;
237 char[] array = text.ToCharArray();
238 bool flag = false;
239 for (int i = 0; i < array.Length; i++)
240 {
241 if (!XmlCharType.IsWhiteSpace(array[i]))
242 {
243 flag = true;
244 num++;
245 array[num] = array[i];
246 }
247 else if (flag)
248 {
249 flag = false;
250 num++;
251 array[num] = ' ';
252 }
253 }
254 if (num > -1 && array[num] == ' ')
255 {
256 num--;
257 }
258 return new string(array, 0, num + 1);
259 }
override object Evaluate(XPathNodeIterator nodeIterator)
static bool IsWhiteSpace(char ch)

References MS.Internal.Xml.XPath.StringFunctions._argList, System.Xml.Dictionary, and System.Xml.XmlCharType.IsWhiteSpace().

Referenced by MS.Internal.Xml.XPath.StringFunctions.Evaluate().