public static IEnumerable SplitString(SqlChars input, SqlChars splitter) { string[] array; if (input.IsNull) { array = new string[] { null }; } else if (splitter.IsNull) { array = new string[] { input.ToSqlString().Value }; } else { string inputStr = input.ToSqlString().Value; string sepStr = splitter.ToSqlString().Value; string[] separatorsArray = sepStr.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries); array = inputStr.Split(separatorsArray, StringSplitOptions.RemoveEmptyEntries); } return array; }
/// <summary> /// Converts the value of the specified SqlChars to its equivalent SqlString representation. /// </summary> /// <param name="value">An SqlChars.</param> /// <returns>The SqlString equivalent of the SqlChars.</returns> public static SqlString ToSqlString(SqlChars value) { return value.ToSqlString(); }
/// <summary> /// Converts the value of the specified SqlChars to its equivalent String representation. /// </summary> /// <param name="value">An SqlChars.</param> /// <returns>The String equivalent of the SqlChars.</returns> public static String ToString(SqlChars value) { return value.IsNull ? null : value.ToSqlString().Value; }
/// <summary> /// Converts the value of the specified SqlChars to its equivalent XmlDocument representation. /// </summary> /// <param name="value">An SqlChars.</param> /// <returns>The equivalent XmlDocument.</returns> public static XmlDocument ToXmlDocument(SqlChars value) { return value.IsNull ? null : ToXmlDocument(value.ToSqlString().Value); }
/// <summary> /// Converts the value of the specified SqlChars to its equivalent XmlReader representation. /// </summary> /// <param name="value">An SqlChars.</param> /// <returns>The equivalent XmlReader.</returns> public static XmlReader ToXmlReader(SqlChars value) { return value.IsNull ? null : new XmlTextReader(new StringReader(value.ToSqlString().Value)); }
/// <summary> /// Converts the value of the specified SqlChars to its equivalent SqlXml representation. /// </summary> /// <param name="value">An SqlChars.</param> /// <returns>The equivalent SqlXml.</returns> public static SqlXml ToSqlXml(SqlChars value) { return value.IsNull ? SqlXml.Null : new SqlXml(new XmlTextReader(new StringReader(value.ToSqlString().Value))); }
/// <summary>Converts the value from <c>SqlChars</c> to an equivalent <c>SqlString</c> value.</summary> public static SqlString ToSqlString(SqlChars p) { return p.ToSqlString(); }
/// <summary>Converts the value from <c>SqlChars</c> to an equivalent <c>String</c> value.</summary> public static String ToString(SqlChars p) { return p.IsNull ? Configuration.NullableValues.String : p.ToSqlString().Value; }
/// <summary>Converts the value from <c>SqlChars</c> to an equivalent <c>XElement</c> value.</summary> public static XElement ToXElement(SqlChars p) { return p.IsNull ? null : ToXElement(p.ToSqlString().Value); }
/// <summary>Converts the value from <c>SqlChars</c> to an equivalent <c>String</c> value.</summary> public static String ToString(SqlChars p) { return p.IsNull? null : p.ToSqlString().Value; }
public static IEnumerator Split(SqlChars instr, [SqlFacet(IsFixedLength = true, MaxSize = 1)]SqlString delimiter) { return ((instr.IsNull || delimiter.IsNull) ? new SplitString("", ',') : new SplitString(instr.ToSqlString().Value, Convert.ToChar(delimiter.Value))); }