之前写的方法,使用try catch来处理 如果能捕获异常就说明问题 public bool CheckLegal() { double number; bool flag = true; try { foreach (Control c in groupBox1.Controls) { if (c is TextBox) { number = Convert.ToDouble(c.Text.Trim()); } } foreach (Control c in groupBox2.Control
代码: using System; using System.Windows.Forms; namespace CheckInput { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Sure_button_Click(object sender, EventArgs e) { if (CheckIsLegal() && CheckIsNull()) {
[抄题]: Given two strings s1 and s2, write a function to return true if s2 contains the permutation of s1. In other words, one of the first string's permutations is the substring of the second string. Example 1: Input:s1 = "ab" s2 = "eidbaooo
一句话,BigDecimal转为字符串,匹配正则表达式,so easy; 不废话,代码: import java.math.BigDecimal; import java.util.regex.Pattern; public class test { public static void main(String[] args) { BigDecimal a = new BigDecimal(1000); BigDecimal b = new BigDecimal(99.999); String