public static string VerifyPublicId(string publicId)
{
if (publicId == null)
{
throw new ArgumentNullException(nameof(publicId));
}
// returns the position of invalid character or -1
int pos = s_xmlCharType.IsPublicId(publicId);
if (pos != -1)
{
throw CreateInvalidCharException(publicId, pos, ExceptionType.XmlException);
}
return publicId;
}