Replacing text using add_filter

I just managed to fix it using string replacement function in php.

function replace_btn_text( $more_dtls_link, $view ) {
    $link = htmlspecialchars($more_dtls_link);
    $str = str_replace('More Details', 'View Details', $link);
    $new_link = htmlspecialchars_decode($str);
    return $new_link;
}
add_filter( 'awsm_jobs_listing_details_link', 'replace_btn_text',10, 2);

Suggest me if I need to do any improvements here..