How To Convert A Variable To Lower Case In JQuery



TODO:

Have you ever wanted to check a var against a string and ensure case is not an issue?

 

SOLUTION:

var myVar = $('.myCheckboxClass').find(":checked").val().toLowerCase();

 

NOTES:

This script will find my checkbox by class name, as well as checked, and give me the value in lower case.

How To Convert List<T> To A Comma Separated String



TODO:

Have you ever wanted to convert a List<string> to a comma delimited string?

 

SOLUTION:

List<string> list = new List<string>();

list.Add("blah");
list.Add("blah1");
list.Add("blah2");
list.Add("blah3");

string result = String.Join(",", list.ToArray());

 

NOTES:

There are no notes on this topic.