hi this is my code i want to add string in list but i get this error
use of unassigned local variable
and this is my code
List<string> tokens = new List<string>();
int token_number=0 ;
char[] character = file_text.ToCharArray();
int i = 0;
for (; i < character.Length; i++)
{
if (char.IsLetter(character[i]))
{
string local_token;
while (char.IsLetterOrDigit(character[i + 1]) || character[i + 1] == '_')
{
local_token += character[i];
tokens.Add(local_token.ToString());
}
}
}
hi this is my code and i want to add string to my list so get this error Error 2 Use of unassigned local variable 'local_token' C:\Users\Alireza\Documents\Visual Studio 2013\Projects\tslnc\tslnc\Program.cs 46 25 tslnc