static string GetCref(string cref) { if (cref == null || cref.Trim().Length==0) { return ""; } if (cref.Length < 2) { return cref; } if (cref.Substring(1, 1) == ":") { return cref.Substring(2, cref.Length - 2); } return cref; }