Toon posts:

[delphi] explode(); like functie?

Pagina: 1
Acties:

Verwijderd

Topicstarter
weet iemand of een er een explode(); (php) of split(); (perl) 8ige functie in delphi is.
ik moet dus een string en substring kunnen opgeven, dan hakt ie de string in stukjes waar de substring voorkomt en gooit de deeltjes in een array..
iemand?

  • Aetje
  • Registratie: September 2001
  • Laatst online: 18-12-2025

Aetje

Troubleshooting met HAMERRR

Zoek op:
functie pos();
functie copy();

Daarmee kun je hem zelf wel bouwen.
Die zitten beide in System of Sysutils, ben ik ff kwijt...

Forget your fears...
...and want to know more...


Verwijderd

Topicstarter
dit lukt idd wel aardig, bedankt..
maar nou vroeg ik me af of er ook een delete() oid functie was die ongeveer zoals copy werkt..
dat je dit idee krijgt:
code:
1
delete(string, 0, 10);

zo zou ie dan de eerste 10 chars eraf choppen.. iemand die dit weet?

  • Knutselsmurf
  • Registratie: December 2000
  • Laatst online: 15:44

Knutselsmurf

LED's make things better

Uit de help:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Removes a substring from a string.

Unit

System

Category

string handling routines

procedure Delete(var S: string; Index, Count:Integer);

Description

Delete removes a substring of Count characters from string S starting with S[Index]. S is a string-type variable. Index and Count are integer-type expressions. 

If index is larger than the length of the S or less than 1, no characters are deleted.

If count specifies more characters than remain starting at the index, Delete removes the rest of the string. If count is less than 0, no characters are deleted.

- This line is intentionally left blank -