diff --git a/handlers/views_handler_field.inc b/handlers/views_handler_field.inc
index 2495315..e449a9b 100644
--- a/handlers/views_handler_field.inc
+++ b/handlers/views_handler_field.inc
@@ -274,6 +274,9 @@ class views_handler_field extends views_handler {
       }
 
       $value = strip_tags($this->render_altered($fake_item, $tokens));
+      if (!empty($this->options['alter']['trim_whitespace'])) {
+        $value = trim($value);
+      }
     }
 
     return $value;
@@ -319,6 +322,7 @@ class views_handler_field extends views_handler {
         'word_boundary' => array('default' => TRUE),
         'ellipsis' => array('default' => TRUE),
         'strip_tags' => array('default' => FALSE),
+        'trim' => array('default' => FALSE),
         'preserve_tags' => array('default' => ''),
         'html' => array('default' => FALSE),
       ),
@@ -669,6 +673,12 @@ If you would like to have the characters %5B and %5D please use the html entity
         '#description' => t('If checked, all HTML tags will be stripped.'),
         '#default_value' => $this->options['alter']['strip_tags'],
       );
+      $form['alter']['trim_whitespace'] = array(
+        '#type' => 'checkbox',
+        '#title' => t('Remove whitespace'),
+        '#description' => t('If checked, all whitespaces at the beginning and the end of the output will be removed.'),
+        '#default_value' => $this->options['alter']['trim_whitespace'],
+      );
       $form['alter']['preserve_tags'] = array(
         '#type' => 'textfield',
         '#title' => t('Preserve certain tags'),
@@ -807,7 +817,10 @@ If you would like to have the characters %5B and %5D please use the html entity
    * each item to be handled individually.
    */
   function render_text($alter) {
-    $value = trim($this->last_render);
+    $value = $this->last_render;
+    if (!empty($this->options['alter']['trim_whitespace'])) {
+      $value = trim($value);
+    }
 
     if (!empty($alter['alter_text']) && $alter['text'] !== '') {
       $tokens = $this->get_render_tokens($alter);
