<s>[INST] using Python, how do you do trim start and trim end 

 I know in Python there is no native str.trim() function. However there is strip(), lstrip(), and rstrip(). But I want to do the trimming myself without using strip() or the likes 

Here is my code. :
```
def trim_start(input_str):
    # this is going to be a simple function that trims the start of the string
    start_idx = 0 
    while start_idx < len(input_str):
        if input_str[start_idx] != " ":
            break 
        start_idx +=1 

    return input_str[start_idx:] 

def trim_end(input_str):
# This function trims the end of the string 
    end_idx = len(input_str)-1 
    while end_idx > -1 :
        if input_str[end_idx] != " ":
            break
        end_idx -=1 
    return input_str[:end_idx+1] 

```
**my  questions is as what if  the string contains other type of whitespace such as tabs or newline or feeding like \t, \n etc?[/INST]