///
/// Remove and return the last item in the list, otherwise return null.
///
///
///
///
public static TType TakeLast
if ( list == null ) {
throw new ArgumentNullException( "list" );
}
var index = list.Count - 1;
if ( index < 0 ) {
return default( TType );
}
var item = list[ index ];
list.RemoveAt( index );
return item;
}
No comments:
Post a Comment