anchor.diff:      Result:= temp;
   End;
   
  +Function StrEscapeAllCharsBy(Const aReceiver: String; const aSetOfChars: TSetOfChars; const anEscapeChar: char): String;
  +Var
  +  i : Integer;
  +  tmpChar : Char;
  +Begin
  +  Result := '';
  +
  +  for i := 1 To length(aReceiver) do
  +  begin
  +    tmpChar := aReceiver[i];
  +
  +    if (tmpChar = anEscapeChar) or (tmpChar IN aSetOfChars) then
  +      result := result + anEscapeChar + tmpChar
  +    else
  +      result := result + tmpChar;
  +  end;
  +end;
  +
  +const
  +  StartPunctuationChars: set of char =
  +    [ '(', '[', '{', '<', '''', '"' ];
  +
  +  EndPunctuationChars: set of char =
  +    [ ')', ']', '}', '>', '''', '"', '.', ',', ':', ';', '!', '?' ];
  +
  +procedure TrimPunctuation( var s: string );
  +var
  +  ChangesMade: boolean;
  +  c: Char;
  +begin
  +  while Length(s) > 0 do
  +  begin
  +    ChangesMade := false;
  +    c := s[1];
  +    if c in StartPunctuationChars then
  +    begin
  +      ChangesMade := true;
  +      Delete(s, 1, 1);
  +    end;
  +
  +    if Length(s) = 0 then
  +      exit;
  +
  +    c := s[Length(s)];
  +    if c in EndPunctuationChars then
  +    begin
  +      ChangesMade := true;
  +      Delete(s, Length(s), 1);
  +    end;
  +
  +    if not ChangesMade then
  +      exit; // done
  +  end;
  +end;
  +
  +function IsDomainName( const s: string; StartingAt: longint ): boolean;
  +var
  +  DotPos: longint;
  +  t: string;
  +begin
  +  Result := false;
  +  t := Copy(s, StartingAt+1, Length(s));
  +
  +  // must be a dot in the domain...
  +  DotPos := pos('.', t);
  +  if DotPos = 0 then
  +    // nope
  +    exit;
  +
  +  // must be some text between start and dot,
  +  // and between dot and end
  +  // ie. a.b not .b or a.
  +
  +  if DotPos = Length(t) then
  +    // no b;
  +    exit;
  +
  +  Result := true;
  +end;
  +
  +function IsEmailAddress( const s: string ): boolean;
  +var
  +  AtPos: longint;
  +  SecondAtPos: longint;
  +begin
  +  result := false;
  +  // must be a @...
  +  AtPos := pos('@', s);
  +  if AtPos = 0 then
  +    // no @
  +    exit;
  +  if AtPos = 1 then
  +    // can't be the first char though
  +    exit;
  +
  +  // there is? There must be only one though...
  +  SecondAtPos := LastDelimiter('@', s);
  +  if (SecondAtPos <> AtPos) then
  +    // there's a second @
  +    exit;
  +
  +  Result := IsDomainName( s, AtPos + 1 );
  +end;
  +
  +function CheckAndEncodeURL( var s: string ): boolean;
  +  // simple userfriendly routine
  +  function StartsWith(const s:string; const text: string): boolean;
  +  begin
  +    Result := pos(text, s) = 1;
  +  end;
  +
  +begin
  +
  +  if StartsWith(s, 'www.') then
  +  begin
  +    if not IsDomainName( s, 4 ) then
  +      exit;
  +    Insert('http://', s, 1);
  +    Result := true;
  +    exit;
  +  end;
  +
  +  if StartsWith(s, 'ftp.') then
  +  begin
  +    if not IsDomainName( s, 4 ) then
  +      exit;
  +    Insert('ftp://', s, 1);
  +    Result := true;
  +    exit;
  +  end;
  +
  +  if    StartsWith(s, 'http://' )
  +     or StartsWith(s, 'https://' )
  +     or StartsWith(s, 'ftp://' )
  +     or StartsWith(s, 'mailto:' )
  +     or StartsWith(s, 'news:' ) then
  +  begin
  +    Result := true;
  +    exit;
  +  end;
  +
  +  if IsEmailAddress( s ) then
  +  begin
  +    Insert('mailto:', s, 1);
  +    Result := true;
  +    exit;
  +  end;
  +
  +  Result := false;
  +end;
  +
   Function IncrementNumberedString( StartString: string ): string;
   Var
     Number: string;
  
positive.code:                            var KeyValue: string );
  
  // Removes spaces around the separator in the given string
  Procedure RemoveSeparatorSpaces( var S: string;
                                   const Separator:string );
  
  {$ifdef os2}
  // ------------ Ansi String utilities ------------------------
  
negative.code: 
  // Returns S without double quotes
  Function StrUnDoubleQuote( const s: string ): string;
  // Returns aString enclosed in single quotes
  Function StrInSingleQuotes(const aString : String) : String;
  // Returns aString enclosed in double quotes
  Function StrInDoubleQuotes(const aString : String) : String;
  
  
  //
  
  