如何使IP的最后一位为*?
如下:
 十届全国人大表决通过修改个税法 起征点1600元 发表评论 IP:218.61.233.*
请给出详细代码。
谢谢!

解决方案 »

  1.   

    "218.61.233.11".substring("218.61.233.11".lastindexof(".")) & "*"
      

  2.   

    假如ip为:218.61.233.11string[] str = ip.Split('.');
    将数组的最后一个值替换成*,重新输出数组即可
      

  3.   

    string strIP = "218.61.233.85";
    int index = strIP.LastIndexOf("*");
    strIP = strIP.SubString(0,index -1) + "*";
      

  4.   

    string strIP = "218.61.233.85";
    int index = strIP.LastIndexOf("*");
    strIP = strIP.SubString(0,index -1) + ".*";
      

  5.   

    楼上的错误了。
    string strIP = "218.61.233.85";
    int index = strIP.LastIndexOf(".");
    strIP = strIP.SubString(0,index -1) + "*";
      

  6.   

    string strIP = "218.61.233.85";
    int index = strIP.LastIndexOf(".");
    strIP = strIP.Substring(0,index+1) + "*";
      

  7.   

    ip.Substring(0,ip.LastIndexOf(".")+1)+"*"
      

  8.   

    string a=218.61.233.2
    string b=a.Substring(1,a.Length-1)+"*";
    试一试我的这个!
      

  9.   

    string strIP = "218.61.233.85";
    int index = strIP.LastIndexOf(".");
    strIP = strIP.Substring(0,index+1) + "*";
      

  10.   

    string strIP = "218.61.233.111";
    int index = strIP.LastIndexOf(".");
    strIP = strIP.Substring(0,index+1) + "*";