Possible duplicate:What is the sscanf Java equivalent for parsing values ββfrom a string using a well-known pattern?
I am new to Java, but seeing how useful the sscanf function is, I wonder if there is an equivalent in Java. I have many fairly formatted strings (namely, to write a scripting language for my purposes), so regular expressions are redundant here.
Scanner scanner = new Scanner ("2 A text 3 4"); scanner.nextInt (); // 2 scanner.next (); // A scanner.next (); // text scanner.nextInt (); // 3 scanner.nextInt (); // 4 // and so on.
Here is the official documentation for the Scanner class.
Source: https://habr.com/ru/post/1411855/More articles:Unique XML Schema Child Elements - xmlUmbraco Learn: How to search inside a data type for embedded content? - luceneLinux heap structure and behavior with malloc () and free () - ciPhone authentication - app-storeHow to configure Clojure library at runtime? - pythonImages do not stack properly - jqueryGFortran equivalent ieee_exceptions - fortranESB for Python? - pythonIrony Generation AST Cancels Exception - parsingHow can I use PHP reflection to set a static property? - phpAll Articles