Gravatar for undefined
6 Likes

cleans the first occurence of char from str reference.

cleanChar (str:string, char:string) : string

cleans the first occurence of `char` from `str` reference.

Example

 cleanChar('hello', 'h') // => 'ello'
`

Arguments

str: string

string to perform cleaning on.

char: string

character to clean from string

Returns

string

cleaned string.

Test Summary

#cleanChar() should clean first char `h` from string `hello`Pass
#cleanChar() should return string `foo` without any change as char `z` is not containedPass
#cleanChar() should never mutate given string referencePass