Regular expressions are often used

 

 

1, obtaining the intermediate 1 (alarm status acquired from the block encoding, block encoding format: Sensor Number - alarm status - Start ID)

string str = "080911-1-100104";
var m = Regex.Match(str, "[0-9]+-([0-9]+)-[0-9]+");
return m.Groups[1].Value == "1" ? true : false;

 

Guess you like

Origin www.cnblogs.com/guxingy/p/11137060.html