C
Chris Mayers
Can someone please try this, and tell me what happens, cause either I've got
a weird bug in my VS2003, or I'm going mad...
C#
public void UpdateComments(string customerId, string comment)
{
string firstPart;
string secondPart;
int lengthOfString = comment.Length;
if (lengthOfString >= 200)
{
firstPart = comment.Substring(0,200);
secondPart = comment.Substring(200);
}
else
{
firstPart = comment;
secondPart = "";
}
<... Rest of Method...>
}
Couldn't be much simpler eh?
However if I run this in debug mode, and step through the code, then if my
string is longer or equal to 200 then all is well. IF however the string is
less than 200, the code jumps right over the else part of the method and
carries on with the 'Rest Of Method' code.
Anybody tell me what the **** is going on...?
TIA,
Chris
a weird bug in my VS2003, or I'm going mad...
C#
public void UpdateComments(string customerId, string comment)
{
string firstPart;
string secondPart;
int lengthOfString = comment.Length;
if (lengthOfString >= 200)
{
firstPart = comment.Substring(0,200);
secondPart = comment.Substring(200);
}
else
{
firstPart = comment;
secondPart = "";
}
<... Rest of Method...>
}
Couldn't be much simpler eh?
However if I run this in debug mode, and step through the code, then if my
string is longer or equal to 200 then all is well. IF however the string is
less than 200, the code jumps right over the else part of the method and
carries on with the 'Rest Of Method' code.
Anybody tell me what the **** is going on...?
TIA,
Chris