vnlagrla Cheater
Reputation: 0
Joined: 10 Apr 2011 Posts: 33
|
Posted: Tue Nov 15, 2011 8:02 pm Post subject: Help with c# |
|
|
I need to put in numbers and translate them to letters accordingly 1=a 2=b and so on.
it just returns string.empty so my question would be how can I change or set a string value that is already defined?
I have it set up like this
private void button2_Click(object sender, EventArgs e)
{
string text = string.Empty;
getText(text);
textBox14.Text = text;
}
public void getText(string retext)
{
if (checkBox6.Checked)
{
string leter1 = (textBox26.Text);
string leter2 = (textBox22.Text);
string leter3 = (textBox25.Text);
string leter4 = (textBox21.Text);
string nleter1 = string.Empty;
string nleter2 = string.Empty;
string nleter3 = string.Empty;
string nleter4 = string.Empty;
getValues(leter1, nleter1);
getValues(leter2, nleter2);
getValues(leter3, nleter3);
getValues(leter4, nleter4);
retext = nleter1 + nleter2 + nleter3 + nleter4;
}
}
public void getValues(string a, string b)
{
if (a == 1.ToString())
{
b = "a";
}
if (a == 2.ToString())
{
b = "b";
} //all the way till z
}
any help greatly appreciated I have about 2 hours to work on it more tomorrow and I hope I can get it done by then.
|
|