Delphi - TRUNCAR STRING

 
Vista:

TRUNCAR STRING

Publicado por Antonio (16 intervenciones) el 04/03/2002 08:22:33
ME GUSTARIA SABER COMO PUEDO TRUNCAR LETRAS DE UN STRING ME EXPLICO SI TENGO LA PALABRA NOTA Y QUIERO QUITARLE 'NO' COMO LO HAGO
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:TRUNCAR STRING

Publicado por DAVID (13 intervenciones) el 04/03/2002 11:39:06
Facil con la funcion: Copy.
ejemplo:
letra := 'NOTA';
letra := Copy(letra,2,2); // resultado letra = 'TA'

Otro ej. mas complicado. Tienes un lo siguiente:

letra := 'PEREZ PEREZ, PEDRO'

// Con lo que quieres separar el nombre de los apellidos

Posicion := Pos(',',letra); // nos quedamos con la posicion de la coma

Apellidos := Copy(letra,0,Posicion-1); // PEREZ PEREZ
Nombre := Copy(letra,Posicion+1,length(letra)); // PEDRO

Es facil. Un Saludo
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:TRUNCAR STRING

Publicado por Ramon (1 intervención) el 10/05/2010 12:30:04
Muy buena solución, gracias
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar