有几个0
string t = "0001203";
int tLen = t.Length - t.TrimStart('0').Length;
charAt方法
using System;
 
 namespace Company{
 
     public class TestMain{
         static void Main(){
             string str = "abcdefg";
             string n_str = str.CharAt(3);
             Console.WriteLine(n_str);
         }
     }
     
     public static class CharAtExtention{
         public static string CharAt(this string s,int index){
             if((index >= s.Length)||(index<0))
                 return "";
             return s.Substring(index,1);
         }
     }
 }

 

相关文章:

  • 2023-03-16
  • 2022-12-23
  • 2021-12-28
  • 2022-12-23
  • 2022-12-23
  • 2022-01-21
猜你喜欢
  • 2021-08-26
  • 2021-10-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
  • 2023-03-21
相关资源
相似解决方案