zoukankan      html  css  js  c++  java
  • 小技巧(一)分离字符串string str="(1,10,100,1000,10000,)";

    string str="(1,10,100,1000,10000,)";
    str
    =str.Trim('(').Trim(')').Trim(',');//去掉开头和结尾的“(”、“)”和“,”
    string[] strArr=str.Split(',');
    for(int i=0;i<strArr.Length;i++)
    {
    Response.Write(strArr[i]
    +"<br>");
    }


    输出为
    1
    10
    100
    1000
    10000

    +++++++++++++++++++++++++++++++++

       double ab=Convert.ToDouble(this.TextBox1.Text);
       double ac=Convert.ToDouble(this.TextBox2.Text);
       this.Label1.Text = Convert.ToDouble(ab / (ab + ac)).ToString("0.00%");

  • 相关阅读:
    Java IO流
    Java中Char和Byte的区别
    Java常用类
    View
    3 View
    View
    3 View
    3 View视图 URLconf
    2 Model层
    2 Model层-模型成员
  • 原文地址:https://www.cnblogs.com/Fooo/p/399866.html
Copyright © 2011-2022 走看看