Here are the examples of the csharp api string.TrimEx(bool) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
2 Examples
19
Source : Ext.cs
with MIT License
from zamgi
with MIT License
from zamgi
public static HashSet< string > ToHashset( this IEnumerable< string > seq, bool toUpperInvariant )
{
var hs = new HashSet< string >( seq.Select( d => d.TrimEx( toUpperInvariant ) ).Where( d => !string.IsNullOrEmpty( d ) ) );
return (hs);
}
19
Source : Ext.cs
with MIT License
from zamgi
with MIT License
from zamgi
public static Dictionary< string, T > ToDictionary< T >( this IEnumerable< KeyValuePair< string, T > > seq, bool toUpperInvariant )
{
var dict = new Dictionary< string, T >();
foreach ( var pair in seq )
{
var key = pair.Key.TrimEx( toUpperInvariant );
if ( string.IsNullOrEmpty( key ) )
continue;
if ( dict.ContainsKey( key ) )
continue;
dict.Add( key, pair.Value );
}
return (dict);
}