Show / Hide Table of Contents
  • MaybeSharp
    • Maybe<T>
      • As
      • Bind
      • Cast
      • CompareTo
      • Equality
      • Equals
      • Explicit
      • GetHashCode
      • GreaterThan
      • GreaterThanOrEqual
      • HasValue
      • Implicit
      • Inequality
      • IsEmpty
      • LessThan
      • LessThanOrEqual
      • Maybe
      • Nothing
      • ToString
      • Value
  • MaybeSharp.Extensions
    • MaybeDictionaryExtensions
      • TryGetValue
    • MaybeExtensions
      • Coalesce
      • Or
      • Select
      • SelectMany
      • SelectNonempty
      • ToNullable
      • ValueOr
      • ValueOrException
      • WhenNothing
      • WhenSomething
      • Where
    • MaybeStringExtensions
      • TryParseBoolean
      • TryParseByte
      • TryParseChar
      • TryParseDateTime
      • TryParseDateTimeOffset
      • TryParseDecimal
      • TryParseDouble
      • TryParseInt
      • TryParseInt16
      • TryParseInt64
      • TryParseSingle
    • NullableExtensions
      • ToMaybe

Method ToString

ToString()

Returns the string <nothing> if IsEmpty is true, otherwise returns the result of the ToString method of the inner Value.

Declaration
public override string ToString()
Returns
Type Description
System.String
Overrides
System.ValueType.ToString()

ToString(String, IFormatProvider)

Formats the value of the current instance using the specified format.

Declaration
public string ToString(string format, IFormatProvider formatProvider)
Parameters
Type Name Description
System.String format

The format string to use.

IFormatProvider formatProvider

A format provider instance to use.

Returns
Type Description
System.String

A string containing the formatted value.

Remarks

If the instance is empty or the inner value does not support then returns the same result as ToString(), otherwise returns the formatted string of the inner value.

Back to top Copyright (c) 2017 Troy Willmot