hello ..
Am Facing a problem with comparing 2 arrays values ..
my output that i need is :
if the text = " hi"
then the new array will be like this :
note where the change is :- first 2 elements ...
{"h","i","a","b","c","d","e","f","g","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
my code do every thing right but my problem is when i want to shift array elements from the first to where the (text from textbox ) ends ..
the code am using is :
static String[] arrayofstring = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
String[] arraywithkey = new string[arrayofstring.Length];
private void btn_Click(object sender, EventArgs e)
{
int txtlength = txttext.Text.Length - 1;
for (int i = 0; i <= txtlength; i++)
{
string s = txttext.Text.Substring(i, 1);
arraywithkey[i] = s;
}
for (int j = 0; j <= 25; j++)
{
for (int h = txtlength+1 ; h <= 25; h++)
{
if (arraywithkey[j] == arrayofstring[j])
{
break;
}
else
{
MessageBox.Show("h is :"+h);
MessageBox.Show("j is :"+j);
arraywithkey[h] = arrayofstring[j];
}
}
}
}
thanks in advance ...