AGS.CScript.Compiler.FastString.Trim C# (CSharp) Method

Trim() public method

public Trim ( ) : FastString
return FastString
        public FastString Trim()
        {
            return new FastString(this.ToString().Trim());
        }

Usage Example

Example #1
0
        private static bool AdjustFunctionListForExtenderFunction(List<ScriptStruct> structs, ref List<ScriptFunction> functionList, ref FastString script)
        {
            if (script.StartsWith("this "))
            {
                GetNextWord(ref script);
                string structName = GetNextWord(ref script);
                while ((script[0] != ',') && (script[0] != ')') && (script.Length > 1))
                {
                    script = script.Substring(1);
                }
                if (script[0] == ',')
                {
                    script = script.Substring(1);
                }
                script = script.Trim();

                foreach (ScriptStruct struc in structs)
                {
                    if (struc.Name == structName)
                    {
                        functionList = struc.Functions;
                        return true;
                    }
                }
                ScriptStruct newStruct = new ScriptStruct(structName);
                functionList = newStruct.Functions;
                structs.Add(newStruct);
                return true;
            }
            return false;
        }