in one of our templates for report printing there is the following code:
if (!string.IsNullOrEmpty(assetModel.Belongings))
{
description = string.Format("{0}{1}{2}",
description,
string.IsNullOrEmpty(description) ? "" : ", ",
assetModel.Belongings);
}
I would like to test the first character of the Belongings field. if it IS NOT a "," then the code above should be used but if it IS a "," the code should be like:
if (!string.IsNullOrEmpty(assetModel.Belongings))
{
description = string.Format("{0}{1}{2}",
description,
string.IsNullOrEmpty(description) ? "" : "",
assetModel.Belongings);
}
Please help, how can I test this value of the first character?