Show / Hide Table of Contents

Class Extensions

Extension methods used internally in Trimmer. (In a separate namespace so that importing sttz.Trimmer won't import them).

Inheritance
System.Object
Extensions
Namespace: sttz.Trimmer.Extensions
Assembly: Trimmer.dll
Syntax
public static class Extensions

Methods

| Improve this Doc View Source

AddRange<TSource>(ICollection<TSource>, IEnumerable<TSource>)

Add all elements from an enumerable to the collection.

Declaration
public static void AddRange<TSource>(this ICollection<TSource> collection, IEnumerable<TSource> elements)
Parameters
Type Name Description
System.Collections.Generic.ICollection<TSource> collection
System.Collections.Generic.IEnumerable<TSource> elements
Type Parameters
Name Description
TSource
| Improve this Doc View Source

EqualsIgnoringCase(String, String)

Checks if the string equals the current one, ignoring case (using ordinal comparison).

Declaration
public static bool EqualsIgnoringCase(this string first, string second)
Parameters
Type Name Description
System.String first
System.String second
Returns
Type Description
System.Boolean
| Improve this Doc View Source

GetOptionCapabilities(Type)

Get the OptionCapabilities of an Option type defined by the CapabilitiesAttribute or OptionCapabilities.Default, if no attribute exists.

Declaration
public static OptionCapabilities GetOptionCapabilities(this Type optionType)
Parameters
Type Name Description
System.Type optionType
Returns
Type Description
OptionCapabilities
| Improve this Doc View Source

IterateWith<TFirst, TSecond>(IEnumerable<TFirst>, IEnumerable<TSecond>)

Iterate two enumerations together, ending whenever one of the enumerations reaches its end.

Declaration
public static IEnumerable<Extensions.Pair<TFirst, TSecond>> IterateWith<TFirst, TSecond>(this IEnumerable<TFirst> first, IEnumerable<TSecond> second)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<TFirst> first
System.Collections.Generic.IEnumerable<TSecond> second
Returns
Type Description
System.Collections.Generic.IEnumerable<Extensions.Pair<TFirst, TSecond>>
Type Parameters
Name Description
TFirst
TSecond
| Improve this Doc View Source

Join(IEnumerable<String>, String)

Join together a enumerable of strings.

Declaration
public static string Join(this IEnumerable<string> collection, string separator = ", ")
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<System.String> collection
System.String separator
Returns
Type Description
System.String
| Improve this Doc View Source

ReplaceCaseInsensitive(String, String, String)

Replace all occurrences of a string by a new value, ignoring the case of the original string and the search value.

Declaration
public static string ReplaceCaseInsensitive(this string str, string oldValue, string newValue)
Parameters
Type Name Description
System.String str
System.String oldValue
System.String newValue
Returns
Type Description
System.String
Remarks

Based on this Stackoverflow answer by JeroenV: https://stackoverflow.com/a/25426773/202741

  • Improve this Doc
  • View Source
Back to top © 2017 Adrian Stutz