C# Class JDP.Remediation.Console.Common.Utilities.CommonUtility

显示文件 Open project: OfficeDev/PnP-Transformation

Public Methods

Method Description
CleanInvalidXmlChars ( string text ) : string
GetUrl ( string WebApplicationUrl, string Url ) : string

Returns a string Url by combining the WebAplicationUrl and the Input Url (Which Can be - SiteCollectionUrl, WebUrl and PageUrl)

GetXmlDocumentFromString ( string xml ) : XmlDocument
IsLegalXmlChar ( int character ) : bool

Whether a given character is allowed by XML 1.0.

SanitizeXmlString ( string xml ) : string
SplitToLines ( string stringToSplit ) : IEnumerable

Excel/CSV Cell CharacterLimit. According to Microsoft's documentation: https://support.office.com/en-us/article/Excel-specifications-and-limits-1672b34d-7043-467e-8e27-269d656771c3 Excel cannot read more than 32767 characters in a single cell Total number of characters that a cell can contain: 32,767 characters This function checks if the value of a column is more than 32,767 characters, and if it finds any it splits the data into rows so as to save it in csv/excel

Method Details

CleanInvalidXmlChars() public static method

public static CleanInvalidXmlChars ( string text ) : string
text string
return string

GetUrl() public static method

Returns a string Url by combining the WebAplicationUrl and the Input Url (Which Can be - SiteCollectionUrl, WebUrl and PageUrl)
public static GetUrl ( string WebApplicationUrl, string Url ) : string
WebApplicationUrl string
Url string
return string

GetXmlDocumentFromString() public static method

public static GetXmlDocumentFromString ( string xml ) : XmlDocument
xml string
return System.Xml.XmlDocument

IsLegalXmlChar() public static method

Whether a given character is allowed by XML 1.0.
public static IsLegalXmlChar ( int character ) : bool
character int
return bool

SanitizeXmlString() public static method

public static SanitizeXmlString ( string xml ) : string
xml string
return string

SplitToLines() public static method

Excel/CSV Cell CharacterLimit. According to Microsoft's documentation: https://support.office.com/en-us/article/Excel-specifications-and-limits-1672b34d-7043-467e-8e27-269d656771c3 Excel cannot read more than 32767 characters in a single cell Total number of characters that a cell can contain: 32,767 characters This function checks if the value of a column is more than 32,767 characters, and if it finds any it splits the data into rows so as to save it in csv/excel
public static SplitToLines ( string stringToSplit ) : IEnumerable
stringToSplit string
return IEnumerable