PAGUE 6 MESES
LEVE 12 MESES
GARANTIR DESCONTO

Fórum Como separar os nomes de um arquivos no listview? Entre um carácter?? #606465

07/11/2019

0

Olá amigos bom dia.
Estou com um projeto já algum tempo, mas estou atualizando ele para maiores informações na empresa, o que preciso é: quando importar os arquivos (nomes) da música para o listview, ele separe o artista do título, ou por exemplo em uma coluna ele coloca o que está antes do carácter -, e na outra o título, ele coloca o que está depois do carácter -

por exemplo

Blitz - A Dois passos do paraíso

coluna 1 coluna 2
Blitz A dois passos do paraíso

Agradeceria muito pela ajuda desta função.
Obrigado a todos.
Júnior Pinheiro

Júnior Pinheiro

Responder

Posts

25/11/2019

Júnior Pinheiro

Problema resolvido.

function artista(pStrValue: string): string;
var
  sArtista : string;
  i: Integer;
begin
  if sArtista = '' then
     begin
       result := copy (pStrValue,1, Length(pStrValue)-4);
       for I := 1 to length(pStrValue) do
         begin
           if ((pStrValue[i] = '-') and
               (pStrValue[i-1] = ' ') and
               (pStrValue[i+1] = ' ')) then
            begin
              if length(pStrValue) > (i+4) then
                 begin
                   result := trim(copy (pStrValue,1,i-1))
                 end;
            end;
         end;
     end;
end;
Responder

Gostei + 0

27/11/2019

Júnior Pinheiro

Agradeço pela ajuda.
Resolvido.

Problema resolvido.

function artista(pStrValue: string): string;
var
  sArtista : string;
  i: Integer;
begin
  if sArtista = '' then
     begin
       result := copy (pStrValue,1, Length(pStrValue)-4);
       for I := 1 to length(pStrValue) do
         begin
           if ((pStrValue[i] = '-') and
               (pStrValue[i-1] = ' ') and
               (pStrValue[i+1] = ' ')) then
            begin
              if length(pStrValue) > (i+4) then
                 begin
                   result := trim(copy (pStrValue,1,i-1))
                 end;
            end;
         end;
     end;
end;
Responder

Gostei + 0

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar