Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Extension method: string SubstringSafe(this string, int, int)

Declaration

public static string SubstringSafe(
    this string source,
    int startIndex,
    int length
)

Summary

Same as string.Substring(int, int) but does not throw exceptions when the start index or length (or both) fall outside the boundaries of the string. Instead the result is truncated as appropriate.