ZivehDesigne
سه شنبه 24 دی 1392, 23:40 عصر
سلام دوستان!
من تو یه برنامه باید جای کلمات را عوض کنم مثلا: Ahmad Safavi = Safavi Ahmad
حالا تکه کد زیر رو نوشتم نمی دونم کجا اشکال داره فقط کلمه اولو تکرار میکنه
string M;
string S;
S =null;
M = TextBox1.Text;
string[] a = M.Split();
string[] b = new string[a.Length];
for (int i=a.Length-1;i>=0;i--)
{
for (int j=0;j<=a.Length-1;j++)
{
b[j]=a[i];
}
}
for (int i = 0; i <= a.Length-1; i++)
{
S = S + " " + b[i];
}
TextBox2.Text =S;
ممنون میشم راهنماییم کنید...
من تو یه برنامه باید جای کلمات را عوض کنم مثلا: Ahmad Safavi = Safavi Ahmad
حالا تکه کد زیر رو نوشتم نمی دونم کجا اشکال داره فقط کلمه اولو تکرار میکنه
string M;
string S;
S =null;
M = TextBox1.Text;
string[] a = M.Split();
string[] b = new string[a.Length];
for (int i=a.Length-1;i>=0;i--)
{
for (int j=0;j<=a.Length-1;j++)
{
b[j]=a[i];
}
}
for (int i = 0; i <= a.Length-1; i++)
{
S = S + " " + b[i];
}
TextBox2.Text =S;
ممنون میشم راهنماییم کنید...