Constructs a TimeSpan from a string.
[Visual Basic] Public Shared Function FromString( _ ByVal s As String _ ) As TimeSpan [C#] public static TimeSpan FromString( string s ); [C++] public: static TimeSpan FromString( String* s ); [JScript] public static function FromString( s : String ) : TimeSpan;
A TimeSpan corresponding to the specified string.
Exception Type | Condition |
---|---|
ArgumentException | If the string is a null reference (in Visual Basic Nothing). |
FormatException | If the string cannot be parsed. |
Leading and trailing white space characters are allowed.
TimeSpan Structure | TimeSpan Members | System Namespace | String | ToString