i have a bunch of stored procedure script which i stored in an array. Each array contain a procedure (i.e normal create procedure ......). Howver, when passing to the array, the spaces in text are replaced with \t and \r in the array and the next line are replcaed with \n . I now want to break each procedure text in to words and store in an array. however the split function

```
for (int i = 0; i < text.Length; i++)
{
  string[] words = new string[text[i].Split('\t', '\n').Length];

}

```

the above array words however when i checked, hold strings of a null value. It does not returns the words as it suppose to. I thought may be i have to replace the \n\r\t before splitting, like below...\

```
text[i].Replace("\n", string.Empty)

```

The above still does not work. Please any help would be appreciated. I want to split the text in to string of words. Below is the whole method snapshot. The method receives array of values procedure names, i want the method to extract the procedure text of each given name and then split each storedprocedure text in to words which i will later use. I want to loop through, perform a simple search by determining what word follows after the other.

**Update** 

```
private void text(string[] array)
       {
           DataSet ds = new DataSet();
           string sql = "";
           progressBar1.Value = progressBar1.Minimum;

           using (SqlCommand command = new SqlCommand())
           {
               string[] text = new string[array.Length];
               string[] name = new string[array.Length];
               for (int i = 0; i < array.Length; i++)
               {
                   command.Parameters.Clear();
                   sql = @"SELECT DISTINCT so.name, so.type,text FROM sys.sysobjects so with (nolock) INNER JOIN sys.syscomments sc with (nolock)
                               ON so.id=sc.id WHERE name=@name";
                   command.Connection = getconnection();
                   command.CommandText = sql;
                   command.CommandType = CommandType.Text;
                   command.Parameters.AddWithValue("@name", array[i].ToString());

                   using (SqlDataAdapter adp = new SqlDataAdapter(command))
                   {

                       ds = new DataSet();
                       adp.Fill(ds);
                   }
                   if (ds.Tables[0].Rows.Count > 0)
                   {

                       for (int j = 0; j < ds.Tables[0].Rows.Count; j++)
                       {

                           text[i] = ds.Tables[0].Rows[0]["text"].ToString();
                           name[i] = ds.Tables[0].Rows[0]["name"].ToString();
                       }
                   }
                   double e = (Convert.ToDouble(i) / Convert.ToDouble(array.Length));
                   progressBar1.Value = Convert.ToInt16(e * 100);
               }

               int count = 0 ;

               for (int i = 0; i < text.Length; i++)
               {

                   text[i].Replace("\n", string.Empty); 

                   string[] words = new string[text[i].Split(new string[] { "\t", "\n" }, StringSplitOptions.RemoveEmptyEntries).Length];

                   for(int j = 0; j < words.Length ; j++)
                   {
                      // words[j] = text[i].Split(new string { " " }, StringSplitOptions.None);// = words[j].;
                       words[j] = words[j];
                   }
               }

           }
       }

```