Last active
September 22, 2017 21:52
-
-
Save ugurhasar/fba45e26775f7c1abbeb205e0002b9d9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public string CleanTags(string input) | |
{ | |
char[] charArray = new char[input.Length]; | |
int arrayIndex = 0; | |
bool inside = false; | |
for (int i = 0; i < input.Length; i++) | |
{ | |
char tmp = input[i]; | |
if (tmp == '<') | |
{ | |
inside = true; | |
continue; | |
} | |
if (tmp == '>') | |
{ | |
inside = false; | |
continue; | |
} | |
if (!inside) | |
{ | |
charArray[arrayIndex] = tmp; | |
arrayIndex++; | |
} | |
} | |
return new string(charArray, 0, arrayIndex); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function cleanTags(input) | |
{ | |
var array = []; | |
var inside = false; | |
for (i = 0; i < input.length; i++) | |
{ | |
var let = input.charAt(i); | |
if (let == '<') | |
{ | |
inside = true; | |
continue; | |
} | |
if (let == '>') | |
{ | |
inside = false; | |
continue; | |
} | |
if (!inside) | |
array.push(let); | |
} | |
return array.join(''); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment