Home>
let str: String = ["Tokyo (10)", "Osaka (20)", "Hokkaido (30)"]
If there is an array with the string, 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.
Thank you.
ー ー ー ー ー ー ー ー ー
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
Related articles
- 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
- vba - search and extract a specific string with a function in google sheets
- python - i want to extract a specific character string
- i want to extract specific information from a python string
- python want to extract specific lines from multiple txt files and output to excel
- python - i want to sort the data frame of pandas by row name (rows in a specific range only)
- 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
- ios - i want to determine if i'm currently in the range on the map
- 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~
- python - cannot extract the character string
- i want to extract an array with only specific key values from a dictionary array with swift
- vba:i want to paste a specific range of values into the body of an outlook email
- python - extract specific items from pandas table
- python - beautifulsoup with a specific string
- extracting a specific range with an array [php scraping]
Related questions
- ios - core bluetooth data exchange
- about symbolicate (restore) of crash log due to rejection when applying for swift iosapp
- ios - it is about line breaks when using uitextview wrapped in swift ui
- swift : How to transition so that the NavigationBar is not shared before and after the screen transition?
- ios : Xcode Git creates copies of files
- ios - i want to convert string to date type in swift4
- objective-c - about phpickerviewcontroller for ios14
- i want to change the screen display for each model when creating an ios app with xcode
- ios - i want to display the initial text value of uitextfield in swiftui
- ios - i want to limit the number of characters for multiple uitextviews
I thought it was dejavu ^^;
The answer code below
https://StackOverflow.com/questions/225546
[(. *?)]
should be\ ((. *?) \)
.