I have a string with value "€100,000,000". I want to remove the '€' and ',' at the same time. I am try to use [NSCharacterSet symbolSet]
but this method only removes the '€' without removing the ','.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
- How can I add media attachments to my push notific
Commas are not symbols. It's part of the
[NSCharacterSet punctuationCharacterSet]
. But if you use that set it will remove the decimal place holder (period).You will just have to do two operation to get the result you want.
[NSCharacterSet symbolSet]
which will take care of all symbols for currency.stringByReplacingOccurencesOfStrin
to remove only the","
where string contains
"€100,000,000"
Best solution is Remove all but numbers from NSString answer.
Alternative for fixed cleaning in string is:
You can try:
Use this: