Friday, 4 July 2014

Append comma in string end C#

 string char1 = "";
            for (int i = 0; i < ricmodel.TypeofCharacteristics.Length; i++)
            {
                if (string.IsNullOrEmpty(char1))
                {
                    char1 = ricmodel.TypeofCharacteristics[i];
                }
                else
                {
                    char1 = char1 + "," + ricmodel.TypeofCharacteristics[i];
                }
            }

No comments:

Post a Comment