C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,246 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
i did this way....is it good approach or not ? i use TrimExcess() is it good practice. please guide me. thanks
public static void ListDispose<T>(this List<T> _list)
{
if (_list != null)
{
_list.Clear();
_list.TrimExcess();
_list = null;
}
}
You can find some threads in MSDN forums archives, like :
What List TrimExcess() does and when to use it