Question: I'm using bootstrap 3.3.7 and my navbar is not collapsing on smaller devices. Navbar does appear, but clicking on the `navbar-toggle` button does not bring any options up.

```html
<nav class="navbar navbar-inverse navbar-fixed-top">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-nav-demo" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a href="index.html" class="navbar-brand">
        <div class="orange"><i class="fas fa-football-ball"></i> Fantasy</div>
      </a>
    </div>
    <div class="collapse navbar-collapse" id="bs-nav-demo">
      <ul class="nav navbar-nav">
        <li><a class="active" href="index.html">Home</a></li>
        <li><a href="history.html">History</a></li>
        <li><a href="picks.html">Picks & Busts of the Week</a></li>
        <li><a href="news.html">Important Dates/Announcements</a></li>
        <li><a href="blog.html">Chat/Blog</a></li>
      </ul>
    </div>
  </div>
</nav>
```

Answer: 
### ⚠️ Be aware of using `replacingOccurrences`!

Although this method (mentioned by @Raja Kishan) may work in some cases, it's not forward compatible and will fail if you have unhandled characters (like other expression operators)

---

### ✅ Just write it as you say it:

```
let numbers = "90000+8000-1000*10".split { !$0.isWholeNumber && $0 != "." }

```

You have the numbers! go ahead and count the length

```
numbers[0].count // show 5
numbers[1].count // shows 4

```

---

###  You can also have the operators like:

```
let operators = "90000+8000-1000*10".split { $0.isWholeNumber || $0 == "." }

```
If the sign (operator) is fixed then you can replace all signs with a common one sign and split the string by a common sign.

Here is the example

```
extension String {
    func getSubStrings() -> [String] {
        let commonSignStr = self.replacingOccurrences(of: "+", with: "-").replacingOccurrences(of: "*", with: "-")
        return commonSignStr.components(separatedBy: "-")
    }
}

```

```
let str = "90000+8000-1000*10"
str.getSubStrings().forEach({print($0.count)})

```