Else check if v is true or not . If true , copy character in output string and set v as false .
else if ( str . charAt ( i ) != ' ▁ ' && v == true ) { result += ( str . charAt ( i ) ) ; v = false ; } } return result ; }