CommonLib.cs 567 B

123456789101112131415161718192021222324
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace Model
  7. {
  8. internal class CommonLib
  9. {
  10. public static string RemoveUpToSecondDot(string s)
  11. {
  12. if (string.IsNullOrEmpty(s)) return s;
  13. int first = s.IndexOf('.');
  14. if (first < 0) return s;
  15. int second = s.IndexOf('.', first + 1);
  16. if (second < 0) return s; // 或 return string.Empty,根据需求
  17. return s.Substring(second + 1);
  18. }
  19. }
  20. }