Some netizens asked "How does asp.net determine that a mobile phone number string contains three consecutive characters or three identical characters ?" :
Insus. NET has done some exercises and shared the methods, hoping that netizens can learn from them.
Object-oriented: First, write a Number class to process the Number. It is a very simple class and clear at a glance.
#38 to #41 method, IsUpNumber () determines whether it is a continuous ascending number.
IsDownNumber () is used to determine whether it is a continuous descending number.
#48 to #51, IsSameNumber () is determined to be the same continuous number.
#53 to #57. AppendNumber () is the method for adding new numbers. In the method body, there is also a statistical method, which indicates the number of digits.
#64 to #93 is the override ToString () method.
Next, we need to write another class:
#21 to #33 split the string into a single character, convert it into a number, and store it in a List <T> set. Later, we will analyze and process the data from this set.
#35 to #37 is a set of three types, which are used to store continuous ascending, descending, and identical numbers.
#39 to #79 process data.
#81 to #120 is the output data.
Next let's take a look at the real-time operations. Insus. NET lists some characters. The first two are posted by netizens:
View Code
Go to. aspx. cs:
Real-time operations: