OpenTAP 9.27
API Reference
Static Public Member Functions | List of all members
OpenTap.NumberUnitSplitter Class Reference

A number unit splitter can split a text into numbers and units using whitespaces and changes from digits to characters as splitting points. More...

Static Public Member Functions

static List< Tuple< double, string > > Split (string text, NumberStyles numberParseStyles=NumberStyles.Any, CultureInfo numberParseCulture=null)
 Splits a string into pairs of numbers and units. The units are not evaluated in any way but just returned as strings. Separation points are whitespaces, any switch from digits to characters and vice versa. Dots, commas etc. are considered to belong to numbers, also the character 'e' when it is followed by a sign or digit. You can provide parsing parameters though that may render such a number invalid. For empty input strings, an empty list is returned. In case of invalid numbers, an FormatException is thrown. More...
 

Detailed Description

A number unit splitter can split a text into numbers and units using whitespaces and changes from digits to characters as splitting points.

Member Function Documentation

◆ Split()

static List< Tuple< double, string > > OpenTap.NumberUnitSplitter.Split ( string  text,
NumberStyles  numberParseStyles = NumberStyles.Any,
CultureInfo  numberParseCulture = null 
)
inlinestatic

Splits a string into pairs of numbers and units. The units are not evaluated in any way but just returned as strings. Separation points are whitespaces, any switch from digits to characters and vice versa. Dots, commas etc. are considered to belong to numbers, also the character 'e' when it is followed by a sign or digit. You can provide parsing parameters though that may render such a number invalid. For empty input strings, an empty list is returned. In case of invalid numbers, an FormatException is thrown.

Parameters
textThe text.
numberParseStylesThe accepted styles for number parsing.
numberParseCultureThe culture for number parsing. If omitted, DefaultThreadCurrentCulture is chosen.
Returns
A List<Tuple<double,string>>

OpenTAP 9.27 API built Wed Nov 27 2024 13:14:46