If there is an array with the string
let str: String = ["Tokyo (10)", "Osaka (20)", "Hokkaido (30)"]
, I want to extract only the parts "10", "20", and "30".
Because the number of characters is not constant as shown above in the example,
The method of ◯ letter from the beginning cannot be used.
In my opinion,
The third character from the end, and the range of two characters from that point
I was wondering if it would be like that, but
I can't find anything good ...
I wonder if it is easy.
ー ー ー ー ー ー ー ー ー
This is a postscript.
I want to use this string (10 or 20) for sorting.
I want to use the extracted string as it is, so I want to embed it in one sentence without putting it in a variable.
Answer # 1
I thought it was dejavu ^^;
The answer code below
[(. *?)]should be
\ ((. *?) \).
- i want to extract a specific number string from a string in python
- python - i want to judge and extract the character string of a specific column by pandas with a numerical value
- i want to extract specific information from a python string
- python - i want to extract a specific character string
- vba - search and extract a specific string with a function in google sheets
- python - cannot extract the character string
- how to get the character before a specific string (oracle sql)
- python: extract the value enclosed in the string type 
- python - i want to delete only the end of a line with a specific character string in a regular expression
- vba - i want to extract the middle part of the character string
- i want to extract specific data in a multi-dimensional array with gas to make multiple one-dimensional arrays
- excel2016 extract only specific data (projection)
- Extract specific file path in the folder based on linux command
- python - i want to extract a url consisting of specific characters ~regular expressions~
- vba:i want to paste a specific range of values into the body of an outlook email
- i want to extract an array with only specific key values from a dictionary array with swift
- google apps script - i want to extract specific characters with gas and transfer them to cells
- python - extract specific items from pandas table
- extracting a specific range with an array [php scraping]
- linux - the sed command cannot extract the id with a specific keyword and that keyword
- ios - i want to get only 0 from the array of 0s and 1s
- ios - i want to turn off the swiftlint typealias warning
- ios - [swift/cloudkit] how to edit by a user different from the record creator
- ios - about processing when data could not be obtained by api
- ios - how to use swiftpm with multiple projects in workspace
- ios - i want to display the initial text value of uitextfield in swiftui
- ios - lowercased() gives a warning
- ios - i want to set the title on the screen with tabbar under navigationcontroller in swift5
- about symbolicate (restore) of crash log due to rejection when applying for swift iosapp
- ios - i want to get cell information when i tap a cell in collectionview