Ver Mensaje Individual
  #10  
Antiguo 30-07-2007
adfa adfa is offline
Miembro
 
Registrado: may 2003
Ubicación: Montevideo-Uruguay
Posts: 119
Reputación: 22
adfa Va por buen camino
A ver que les parece esta opción

Con conjuntos me gusto.

Código Delphi [-]
function TForm1.sacarVocalesRepetidas(texto: string): string;
var
  i: integer;
  vocales: set of char;
  ant: char;
begin
  ant     := #0;
  vocales := ['a', 'e', 'i' ,'o' ,'u','A','E','I','O','U'];
  result  := '';
  for i := 1 to length(texto) do
  begin
    if not (texto[i] in vocales) then
      result := result + texto[i]
      else
      if texto[i] <> ant then result := result + texto[i];
    ant := texto[i];
  end;
end;

Saludos

Última edición por adfa fecha: 30-07-2007 a las 21:36:37.
Responder Con Cita