Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public bool CheckPP(string post)
- {
- List<int> start_parens;
- List<int> end_parens;
- int i;
- foreach (Char c in post)
- {
- if (c == '(')
- {
- // Start parentheses.
- start_parens.Add(i);
- }
- elseif (c == ')')
- {
- // End parentheses.
- end_parens.Add(i);
- }
- i++
- }
- i = 0;
- int length; // The length of text in parens.
- foreach (int l in start_parens)
- {
- length += (end_parens[i] - start_parens[i]);
- i++
- }
- if length >= (post.Length / 2) { return true; }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement