Popular Posts
A good url validate regular expression ^(?#Protocol)(?:(?:ht|f)tp(?:s?)\:\/\/|~\/|\/)?(?#Username:Password)(?:\w+:\w+@)?(?#Subdomains)(?:(?:[-\w]+\.)+(?#TopLevel Domains)(?:com|or... JDateField package bruce.lib.swing; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import java.awt.event.A... vi hot key guide 第一部份:一般模式可用的按鈕說明,游標移動、複製貼上、搜尋取代等 移動游標的方法 h 或 向左方向鍵(←) 游標向左移動一個字元 j 或 向下方向鍵(↓) 游標向下移動一個字元 k 或 向上方向鍵(↑) 游標向上移動一個字元 l 或 向右方向鍵(→) 游標...
Stats
Extension method
class Program
{
    static void Main(string[] args)
    {
        Console.WriteLine(StringExtension.UrlEncodeMethod("中文"));
        Console.WriteLine("中文".UrlEncode());
        Console.Read();
    }
}


static class StringExtension
{
    public static string UrlEncodeMethod(string s)
    {
        return HttpUtility.UrlEncode(s);
    }

    public static string UrlEncode(this string s)
    {
        return HttpUtility.UrlEncode(s);
    }
}