How does one check if the title, generated by `wp_title()` has empty space in front of it? I have found how to trim it with `trim()`

```
<?php echo trim(wp_title('', false)); ?>

```

But, like with [setting a `wp_title()` for home page](http://codex.wordpress.org/Function_Reference/wp_title#Covering_Homepage), I'd like to put this in the `functions.php` file, so that it's not in my header. So far I have

```
add_filter( 'wp_title', 'trim_wp_title' );
function trim_wp_title( $title ) {
    if( /* check if $title contains empty space */ ) {
        $title = echo trim(wp_title('', false));
    }
    return $title;
}

```