Question: For `(int -> int) -> int = <fun>` the corresponding expression can be `fun x -> (x 1) + 1`.  

Is it possible to have an expression with `int -> (int -> int) = <fun>` type? If not then why?

Answer: 
> 
> Is this posible with lastIndexOf?
> 
> 
> 

**Yes, it is possible.**

Let's say 

```
x="http://test.com/en/country/city"

```

We get the position of the last `/` 

```
y=x.lastIndexOf("/");//26

```

We get the position of the second last `/`

```
z=x.lastIndexOf("/",y-1);//18

```

To extract the country, we now use `substring` as follows

```
x.substring(z+1,y)//country

```
Try something like this.

```
var url = window.location.href;
var urlArray = url.split("/"); 

urlArray[urlArray.length-1] //City
urlArray[urlArray.length-2] //Country

```