public static SkryptObject ToArray(SkryptEngine engine, SkryptObject self, Arguments arguments)
        {
            var str = self as StringInstance;

            var charArray = str.Value.ToCharArray();
            var array     = engine.CreateArray(new SkryptObject[0]);

            for (var i = 0; i < charArray.Length; i++)
            {
                ArrayInstance.Push(engine, array, new Arguments(engine.CreateString("" + charArray[i])));
            }

            return(array);
        }
        public static SkryptObject ToByteArray(SkryptEngine engine, SkryptObject self, Arguments arguments)
        {
            var str = self as StringInstance;

            var bytes = Encoding.ASCII.GetBytes(str.Value);
            var array = engine.CreateArray(new SkryptObject[0]);

            for (var i = 0; i < bytes.Length; i++)
            {
                ArrayInstance.Push(engine, array, new Arguments(engine.CreateNumber(bytes[i])));
            }

            return(array);
        }
        public static SkryptObject Split(SkryptEngine engine, SkryptObject self, Arguments arguments)
        {
            var str   = self as StringInstance;
            var input = new List <string>();

            for (int i = 0; i < arguments.Values.Length; i++)
            {
                var s = arguments.GetAs <StringInstance>(i);

                input.Add(s.Value);
            }

            var split = str.Value.Split(input.ToArray(), StringSplitOptions.None);

            var stringArray = new StringInstance[split.Length];

            for (int i = 0; i < split.Length; i++)
            {
                stringArray[i] = engine.CreateString(split[i]);
            }

            return(engine.CreateArray(stringArray));
        }