I've been working with strings lately and I'm wondering how to go about solving how to remove remaining string after first / character. 

```
this/is/my/string

```

Expected output:

```
This

```

My code:

```
string = string.slice(0, string.indexOf('/'));
result = string.charAt(0).toUpperCase() + string.slice(1);

```

What I'm getting is `Thi`... What am I doing wrong here? Remove after first / and capitalize doesn't seem to work as expected.