I have a string with url and I want to remove blockquotes and characters after from the string.
String looks like http://pics.v6.top.rbk.ru/v6_top_pics/resized/250xH/media/img/7/92/754435534528927.jpg\"><div>Какой-то div</div>
So i try to make a for-loop which iterates through every character appending the to new string and stops when it finds blockquotes
I try following code
var value = "http://pics.v6.top.rbk.ru/v6_top_pics/resized/250xH/media/img/7/92/754435534528927.jpg\"><div>Какой-то div</div>"
var result = String()
for char in value.characters {
var i = false
if char == "\"" {
let temp: Character = "\""
result.append(temp)
i = true
} else if i != true {
result.append(char)
}
}
print(result)
but it does not work
Also I try while, but it causes infinite loop
for char in value.characters {
while char != "\"" {
print("hello")
}
}
How to do this correctly ?
Thanks in advance!
UPD - i dont need to remove only quotes. I need to remove them AND everything after them