CodePudding user response:
Can not write the homeworkCodePudding user response:
Convert the input string to the stream flow, and then traverse the matching, identified with a counter traverse the position of the movingCodePudding user response:
Homework assignments,,,CodePudding user response:
You this should be a starting position, rather than occurrencesWork or make your own, thinking to progress more
Under the simple provide two ideas,
The console input can use the Scanner to obtain
1, method one: String indexOf (STR, length) method can obtain from the position of the length, the position of the first STR, when not to 1, the use of this cycle can take to
2, the method 2: use need to match the string as a regular match (Pattern.com) from running method, then use the Matcher class to find the last input position (start method)
CodePudding user response:
The private chat I