Extract Integer Part in String
问题 What is the best way to extract the integer part of a string like Hello123 How do you get the 123 part. You can sort of hack it using Java\'s Scanner, is there a better way? 回答1: Why don't you just use a Regular Expression to match the part of the string that you want? [0-9] That's all you need, plus whatever surrounding chars it requires. Look at http://www.regular-expressions.info/tutorial.html to understand how Regular expressions work. Edit: I'd like to say that Regex may be a little