anchor.diff:  %% interface functions
   -export([
       trim/1,
  -	trim_left/1,
  -	trim_right/1,
  +    trim_left/1,
  +    trim_right/1,
  +    trim/2,
  +    trim_left/2,
  +    trim_right/2,
       is_string/1,
  +    first_char/1,
  +    last_char/1,
  +    unquote/1,
  +    unquote/2,
       nospaces/1,
       line/1,
       to_rootname/1,
  
positive.code:     to_lower/1,
      to_upper/1,
      replace/3,
  	truncate/2,
  	truncate/3,
  	split_lines/1,
  	escape_ical/1,
  	test/0
  ]).
  
  -include_lib("include/zotonic.hrl").
  
negative.code: 
  	trim_right(<<C, Rest/binary>>, WS, Acc) ->
  		case C of
  			W when W =< 32 -> trim_right(Rest, <<WS/binary, C>>, Acc);
  			_ -> trim_right(Rest, <<>>, <<Acc/binary, WS/binary, C>>)
  		end;
  	trim_right(<<>>, _WS, Acc) ->
  		Acc.
  
  %% @doc Remove all occurences of a char at the end of the string
  trim_right(B, Char) when is_binary(B) ->
  	trim_right(B, Char, <<>>, <<>>);
  trim_right(L, Char) ->
  	binary_to_list(trim_right(iolist_to_binary(L), Char)).
  
  	trim_right(<<C, Rest/binary>>, Char, WS, Acc) ->
  		case C of
  			Char -> trim_right(Rest, Char, <<WS/binary, C>>, Acc);
  			_ -> trim_right(Rest, Char, <<>>, <<Acc/binary, WS/binary, C>>)
  		end;
  	trim_right(<<>>, _Char, _WS, Acc) ->
  		Acc.
  
  %% @doc Check if the variable is a one dimensional list, probably a string
  is_string([]) -> 
  