I am a new in Android development and I want to write a function which I have written for IOS in swift, so if anybody can help me with this then it will be great :
I want to convert a String from
String1 = "Guardians Of the Galaxy(G.T.G)"
into
String2 = "GTG"
All I want to is to get the value which is inside the brackets and remove the . from it and also if there's any space within them
here's how I do it in Swift maybe it'll help to understand
if the spaceLessFullForm = "Catch Me if You Can"
let SpaceLessFullForm = Fullform.condensedWhitespace
let delimiters: NSCharacterSet = NSCharacterSet(charactersInString: "()")
var splitString: [AnyObject] = SpaceLessFullForm.componentsSeparatedByCharactersInSet(delimiters)
let substring: String = splitString[1] as! String
print(substring)
let dotLessString = substring.stringByReplacingOccurrencesOfString(".", withString: "")
let upperCaseFirstCharcters = dotLessString.stringByReplacingOccurrencesOfString(" ", withString: "")
then my upperCaseFirstCharcters = "CMIUC"