Returns a new DoubleVector instance from a given string representation
using the specified style.
Namespace:
CenterSpace.NMath.CoreAssembly: NMath (in NMath.dll) Version: 5.1.0.0
Syntax
| C# |
|---|
public DoubleVector( string s, NumberStyles styles ) |
| Visual Basic (Declaration) |
|---|
Public Sub New ( _ s As String, _ styles As NumberStyles _ ) |
| Visual C++ |
|---|
public: DoubleVector( String^ s, NumberStyles styles ) |
Parameters
- s
- Type: System..::.String
A string representation of a vector.
- styles
- Type: System.Globalization..::.NumberStyles
One or more number styles.
Remarks
Acceptable string representations are of the form [ v1 v2 v3 ... ]
or 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, is taken as a data separator.
CopyC#
string s = "$4.52 $4.32 $4.56 $9.94 ($0.04) ($5.00)"; DoubleVector v = new DoubleVector( 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"; v = new DoubleVector( s, NumberStyles.Number | NumberStyles.AllowExponent );