You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
443 B
21 lines
443 B
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
|
|
namespace JsonRx.Helper
|
|
{
|
|
public static class Extensions
|
|
{
|
|
static private List<string> trueSet = new List<string> { "true", "1", "yes", "y" };
|
|
|
|
public static Boolean ToBoolean(this string str)
|
|
{
|
|
try
|
|
{ return trueSet.Contains(str.ToLower()); }
|
|
catch { return false; }
|
|
}
|
|
|
|
|
|
}
|
|
}
|