Reputation: 110
I have a problem which may look easy but I can't solve it.
I have a function which returns a string and has two arguments:
public string MyFunc(string ID, string TargetID) // ID is 9999999995 and TargetID is 9999999998
{
return ID + TargetID; // Gives me ID only(9999999995).
}
When I try to put text instead of the ID, it works, but not with a number. I've tried to use StringBuilder but I get the same result.
I use it like this:
MessageBox.Show(MyFunc(Settings.Default.ID, ComboBox1.Text));
Upvotes: 1
Views: 79
Reputation: 110
Thank you everybody, but the problem was in receiving the string from netStream, That was my fault. When sending the string I haven't added the "$" char in the end and so the string maybe was so long or something...
Upvotes: 0
Reputation: 1853
Check the values are not null to be safe and do a String.Concat(...)
Upvotes: 1
Reputation:
The function is working as intended. Check that the incoming parameters ID
and TargetID
actually contain values and they are the values you expect.
Upvotes: 2