Converts the value of the current xtd::version object to its equivalent xtd::ustring representation. A specified count indicates the number of components to return.
- Parameters
-
field_count | The number of components to return. The field_count ranges from 0 to 4. |
- Returns
- The xtd::ustring representation of the values of the major, minor, build, and revision components of the current xtd::version object, each separated by a period character ('.'). The field_count parameter determines how many components are returned.
field_count | Return Value |
0 | An empty string (""). |
1 | major |
2 | major.minor |
3 | major.minor.build |
4 | major.minor.build.revision |
For example, if you create xtd::version object using the constructor xtd::version(1,3,5), xtd::version::to_string(2) returns "1.3" and xtd::version::to_string(4) throws an exception.
- Exceptions
-