 | DoubleVectorParse(TextReader, NumberStyles) Method |
Constructs a DoubleVector instance from a given text reader using
the specified style.
Namespace: CenterSpace.NMath.CoreAssembly: NMath (in NMath.dll) Version: 7.4
Syntaxpublic static DoubleVector Parse(
TextReader reader,
NumberStyles styles
)
Public Shared Function Parse (
reader As TextReader,
styles As NumberStyles
) As DoubleVector
public:
static DoubleVector^ Parse(
TextReader^ reader,
NumberStyles styles
)
static member Parse :
reader : TextReader *
styles : NumberStyles -> DoubleVector
Parameters
- reader TextReader
- A text reader containing a string representation of a vector.
- styles NumberStyles
- One or more number styles.
Return Value
DoubleVector
Remarks
The text representation within the reader must be of the form
[ v1 v2 v3 ... ]. The data elements can be in any format that is
supported by
Double.Parse( string, NumberStyles ). Note that whitespace,
even if set as a group separator, will be taken as a data separator.
string s = "$4.52 $4.32 $4.56 $9.94 ($0.04) ($5.00)";
DoubleVector v = DoubleVector.Parse( new StringReader( s ), NumberStyles.AllowCurrencySymbol | NumberStyles.AllowDecimalPoint | NumberStyles.AllowParentheses );
s = "4.523000E+000 4.323000E+000 4.555000E+000 9.943000E+000 -4.400000E-002 -5.000000E+000";
TextReader reader = new StringReader( s );
v = DoubleVector.Parse( reader, NumberStyles.Number | NumberStyles.AllowExponent );
See Also