# InStr

### **Description**‌

The InStr function returns the 0-based index of the first occurrence of the search string within input, or -1 if the substring is not found.

### **Syntax**

‌The syntax for the InStr function is:

`InStr(input, search)`

#### ‌**Parameters**

‌input - the string in which the search is done.

search - the string which searched for

### ‌**Returns**

‌The InStr function returns an integer.‌

### **Example**

Let's look at some InStr function examples and explore how to use the InStr function.‌

```
InStr("hello world", "h")
Result: 0

InStr("hello world", "e")
Result: 1

InStr("hello world", "o")
Result: 4

return InStr("hello world", " ")
Result: 5

InStr("hello world", "ell")
Result: 1

InStr("hello world", "eo")
Result: -1
```
