Package cli.System.Text

Examples of cli.System.Text.StringBuilder


        }
        else
        {
            ArrayList list = new ArrayList();
            String cmdline = Environment.get_CommandLine();
            StringBuilder sb = new StringBuilder();
            for(int i = 0; i < cmdline.length(); )
            {
                boolean quoted = cmdline.charAt(i) == '"';
                for(;;)
                {
                    while(i < cmdline.length() && cmdline.charAt(i) != ' ' && cmdline.charAt(i) != '"')
                    {
                        sb.Append(cmdline.charAt(i++));
                    }
                    if(i < cmdline.length() && cmdline.charAt(i) == '"')
                    {
                        if(quoted && i > 1 && cmdline.charAt(i - 1) == '"')
                        {
                            sb.Append('"');
                        }
                        i++;
                        while(i < cmdline.length() && cmdline.charAt(i) != '"')
                        {
                            sb.Append(cmdline.charAt(i++));
                        }
                        if(i < cmdline.length() && cmdline.charAt(i) == '"')
                        {
                            i++;
                        }
                        if(i < cmdline.length() && cmdline.charAt(i) != ' ')
                        {
                            continue;
                        }
                    }
                    break;
                }
                while(i < cmdline.length() && cmdline.charAt(i) == ' ')
                {
                    i++;
                }
                if(skip > 0)
                {
                    skip--;
                }
                else
                {
                    if(quoted)
                    {
                        list.Add(sb.ToString());
                    }
                    else
                    {
                        list.AddRange((ICollection)(Object)glob(sb.ToString()));
                    }
                }
                sb.set_Length(0);
            }
            return (String[])(Object)list.ToArray(Type.GetType("System.String"));
        }
    }
View Full Code Here

TOP

Related Classes of cli.System.Text.StringBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.