Any IDea how to Parse a String without using Split method

Any IDea how to Parse a String without using Split method

What do you means exactly?
Because there is pleanty of ways of "modifing" a string - all he string methods.

hmm let me try to explain...

i want to parse a string and save it in Array without using the split function. but em confuse how to attempt. i have idea but problem how to implement. :(

Why? If you have a string and you want to split this string on (for example) "\r\n" - on a Enter key - new line, then why should bother using some other methods or ways, then, simply using a Split() method?

Is there any particular reason? Becuase I dont see it.
Can you show me an example of this string, and how it should look like?

This is my first programe
5 words in text:
This
is
my
first
programe
Press any key to continue . . .

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace StringParser
{
    class Program
    {
        static void Main(string[] args)
        {
            string message;
            char[] delimiter = {' '};
            string[] toSave = new string[100];
            message = "This is my first programe";


            Console.WriteLine(message);

            string[] words = message.Split(delimiter);
            System.Console.WriteLine("{0} words in text:", words.Length);

            foreach (string item in words)

            {
                Console.WriteLine(item);
            }


        }
    }
}

and the output is...

This is my first programe
5 words in text:
This
is
my
first
programe
Press any key to continue . . .

i just want to do the same but without using Split method

I think a simpler solution can be using a ToCharArray() on the string object, then parse the array as you wish

To take whackyboy's post one step further if you want to be really adventurous, convert it to a Char array and then use LINQ on it ;)

(Complete overkill btw)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.