Regular Expression for any number divisible by 60 using C# .Net?

前端 未结 6 1448
梦谈多话
梦谈多话 2021-01-18 10:32

I need to apply validation on input time intervals that are taken in as seconds. Now i am not really good at Regular expressions. So can any body help making a regular expre

6条回答
  •  庸人自扰
    2021-01-18 11:01

    Regular expressions are the wrong tool for this job. Instead, try dividing by 60 and see if there is no remainder:

    if (value % 60 == 0) {
      // is divisible by 60
      // ... do something ...
    }
    

提交回复
热议问题