+ String tempContactNumber;
+ int commaIndex = 0;
+ int semiColonIndex = 0;
+ int index = 0;
+ contactNumber.IndexOf(",", 0, commaIndex);
+ contactNumber.IndexOf(";", 0, semiColonIndex);
+
+ if(commaIndex != -1 && semiColonIndex != -1)
+ {
+ index = commaIndex < semiColonIndex ? commaIndex : semiColonIndex;
+ }
+ else if(commaIndex != -1 || semiColonIndex != -1)
+ {
+ index = commaIndex > semiColonIndex ? commaIndex : semiColonIndex;
+ }
+ else
+ {
+ index = contactNumber.GetLength();
+ }
+ contactNumber.SubString(0, index, tempContactNumber);
+