Advertisement
TLama

Untitled

Aug 28th, 2013
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function RemoveVowels(const Value: string): string;
  2. var
  3.   C: PChar;
  4.   I: Integer;
  5. const
  6.   CharSet = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'];
  7. begin
  8.   Result := '';
  9.   if Value <> '' then
  10.   begin
  11.     I := 1;
  12.     SetLength(Result, Length(Value));
  13.     C := PChar(Value);
  14.     while C^ <> #0 do
  15.     begin
  16.       if not (C^ in CharSet) then
  17.       begin
  18.         Result[I] := C^;
  19.         Inc(I);
  20.       end;
  21.       Inc(C);
  22.     end;
  23.     SetLength(Result, I - 1);
  24.   end;
  25. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement