Removed length()  and added replace()

I figured there is strlen() already in <string.h> so I removed length and replaced everything with strlen() . I also added replace function.