Home>
I use Swift.
I want to extract a character string surrounded by specific characters. What should I do?
Specifically,
"hogehoge 【xxx】 abcdefg"
I want to extract the part enclosed by [] ("xxx" in the above example) from a string such as.
I would be happy if someone could give me advice.
-
Answer # 1
Related articles
- javascript - extract the character string sandwiched between specific character strings
- python - i want to extract the character string excluding the blank characters at the end of the line
- python - i want to extract a specific character string
- python - how to format (extract) only the json part of a character string that contains some json
- i want to extract one character string of text that exists in multiple files with python
- python - i want to judge and extract the character string of a specific column by pandas with a numerical value
- vba - i want to extract the middle part of the character string
- ios - i want to select a character string from the table view after screen transition in swift and display it on the original sc
- python - cannot extract the character string
- i want to extract the character string enclosed in () with vba and overwrite it
- how to extract only the character string with a specific character from the (comma) separated character string with a regular ex
- google apps script - find the character string (a) in the a column of the spreadsheet with gas and enter the character string (b
- xcode - i want to display a character string in uiimage with swift
- python - about the problem that the character string sent from the pc by serial communication cannot be recognized on the arduin
- c # - i want to change the value read as a character string from a csv file to double type
- i want to limit the character strings that can be setstate by specifying the specific character string type in the string type s
- python - i want to delete only the end of a line with a specific character string in a regular expression
- validate the character string received by java scanner one by one, and prompt for re-entry if invalid character is included
- regular expressions - i want to divide the character string into two parts at the specified part
- i want to enter a character string that includes a line break
Related questions
- ios : Swift | Fscalendar
- ios - swipe to erase the text written in uilabel
- ios - [in app store connect] i want to submit the app to the app store for review, but an error occurs
- ios - [swift] i want to register user name at the same time as signing up with firebaseauth
- ios - navigationitem does not work [left, right]
- ios app development question about the notation of the function executed when an item is selected in the alert display
- ios - difference between ":" and "=" when declaring variables and constants
- ios - navigationitem uisearchbar does not work well
- ios - i want to reload the tableview of another view controller when i tap the button
- ios - i want to limit the number of characters for multiple uitextviews
You can extract it using regular expressions.
I have tried it myself, but I think this is good.
Because I've seen an article that doesn't work if I create an NSRange using String.count, I'm using NSString.length (this is a little tricky).