> For the complete documentation index, see [llms.txt](https://zhongwen.gitbook.io/leetcode-report/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zhongwen.gitbook.io/leetcode-report/easy/1119.-remove-vowels-from-a-string.md).

# 1119. Remove Vowels from a String

Given a string `S`, remove the vowels `'a'`, `'e'`, `'i'`, `'o'`, and `'u'` from it, and return the new string.

**Example 1:**

```
Input: "leetcodeisacommunityforcoders"
Output: "ltcdscmmntyfrcdrs"
```

**Example 2:**

```
Input: "aeiou"
Output: ""
```

**Note:**

1. `S` consists of lowercase English letters only.
2. `1 <= S.length <= 1000`

#### 解题要点：

先设一个含有元音的set，遍历字符串，把不是元音的字符加到新string里，返回它。

```python
class Solution(object):
    def removeVowels(self, S):
        """
        :type S: str
        :rtype: str
        """
        res = ""
        vset = {'a','e','i','o','u'}
        for s in S:
            if s not in vset:
                res += s
        return res
```
