Flutter/Tip
[Flutter] 스트링에서 숫자만 빼오는 방법 (How to extract numbers from a string)
아래처럼 하면 스트링에서 숫자만 빼올 수 있다. 코드를 깨끗하게 유지하기 위해서 왠만하면 공용함수로 만들어서 쓰는게 더 좋다. ENG The following approach allows you to extract only numbers from a string. It is advisable to create a reusable function whenever possible for better code organization and maintainability originalString = '123oct7'; // 과정 코드 numberString = originalString.replaceAll(new RegExp(r'[^0-9]'),''); // -> '1237' number = int.parse(..