Format() public static method

Converts a jagged or multidimensional array into a System.String representation.
public static Format ( string format, Array matrix, IMatrixFormatProvider formatProvider ) : string
format string
matrix System.Array
formatProvider IMatrixFormatProvider
return string
Esempio n. 1
0
 /// <summary>
 ///   Returns a <see cref="System.String"/> that represents an array.
 /// </summary>
 ///
 /// <param name="matrix">The matrix.</param>
 ///
 /// <param name="format">
 ///   The format to use when creating the resulting string.
 /// </param>
 ///
 /// <param name="provider">
 ///   The <see cref="IMatrixFormatProvider"/> to be used
 ///   when creating the resulting string. Default is to use
 ///   <see cref="DefaultMatrixFormatProvider.CurrentCulture"/>.
 /// </param>
 ///
 /// <returns>
 ///   A <see cref="System.String"/> that represents this instance.
 /// </returns>
 ///
 /// <example>
 ///   Please see <see cref="CSharpMatrixFormatProvider"/>,
 ///   <see cref="OctaveArrayFormatProvider"/> or <see cref="DefaultArrayFormatProvider"/>
 ///   for examples and more details.
 /// </example>
 ///
 public static string ToString(this double[] matrix, string format, IMatrixFormatProvider provider)
 {
     return(MatrixFormatter.Format(format, matrix, provider));
 }
Esempio n. 2
0
 /// <summary>
 ///   Returns a <see cref="System.String"/> that represents an array.
 /// </summary>
 ///
 /// <param name="array">The array.</param>
 ///
 /// <param name="format">
 ///   The format to use when creating the resulting string.
 /// </param>
 ///
 /// <returns>
 ///   A <see cref="System.String"/> that represents this instance.
 /// </returns>
 ///
 /// <example>
 ///   Please see <see cref="CSharpMatrixFormatProvider"/>,
 ///   <see cref="OctaveArrayFormatProvider"/> or <see cref="DefaultArrayFormatProvider"/>
 ///   for examples and more details.
 /// </example>
 ///
 public static string ToString(this double[] array, string format)
 {
     return(MatrixFormatter.Format(format, array, DefaultArrayFormatProvider.CurrentCulture));
 }
Esempio n. 3
0
 /// <summary>
 ///   Returns a <see cref="System.String"/> that represents a matrix.
 /// </summary>
 ///
 /// <param name="matrix">The matrix.</param>
 ///
 /// <param name="format">
 ///   The format to use when creating the resulting string.
 /// </param>
 ///
 /// <returns>
 ///   A <see cref="System.String"/> that represents this instance.
 /// </returns>
 ///
 /// <example>
 ///   Please see <see cref="CSharpMatrixFormatProvider"/>,
 ///   <see cref="CSharpJaggedMatrixFormatProvider"/>, <see cref="CSharpArrayFormatProvider"/>,
 ///   <see cref="OctaveMatrixFormatProvider"/>, or <see cref="OctaveArrayFormatProvider"/>
 ///   for more details.
 /// </example>
 ///
 public static string ToString(this double[][] matrix, string format)
 {
     return(MatrixFormatter.Format(format, matrix, DefaultMatrixFormatProvider.CurrentCulture));
 }