|
||||||
| Pascal/Delphi Forum for discussing Borland Delphi and Pascal coding techniques, tips and tricks. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Delete(Str: String; Start, Length: Integer)
Hello.
can u help me. I have a code: Code:
procedure Tpa.Button2Click(Sender: TObject);
var
Temp: TStringList;
Index: Integer;
s: Integer;
begin
Temp:= TStringList.Create();
try
for Index:= 0 to FList.Count - 1 do
if ('apple', FList[Index]) <> 0) and (Temp.IndexOf(FList[Index]) = -1)
then Temp.Add(FList[Index]);
try
begin
Temp.SaveToFile('fruits.txt');
end;
except
ShowMessage('error!');
end;
finally
Temp.Free();
end;
end;
I need to remove all 'garbage' after this word. How do I do this? example: 'apple ererewerwer' result: only 'apple' |
|
||||
|
Re: Delete(Str: String; Start, Length: Integer)
How are you defining the end of a word? For example, if you have 'apple ererewerwer' in string Data, then I could do:
Code:
Data := copy(Data,1,pos(' ',Data)-1);
__________________
CodeCall Blog | CodeCall Wiki | Shareware Programming is a branch of mathematics. My CodeCall Blog | My Personal Blog |
|
||||
|
Re: Delete(Str: String; Start, Length: Integer)
How are you defining "garbage"? For example, your case could return either 'apple' or 'apples' depending on whether the s is considered garbage or not.
__________________
CodeCall Blog | CodeCall Wiki | Shareware Programming is a branch of mathematics. My CodeCall Blog | My Personal Blog |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| String insertion in C as part of a string and pointer tutorial | Yuriy M | C and C++ | 1 | 02-20-2009 12:53 PM |
| C++: Just some stuff.... | void_3e01 | Classes and Code Snippets | 17 | 10-14-2008 12:54 PM |
| OOP DB Access Wrapper | digioz | C# Programming | 6 | 09-07-2008 01:58 PM |
| SecurityAudit | vinay | Visual Basic Programming | 27 | 01-07-2008 01:14 PM |
| Help with SendMessage API | MrNobody | Visual Basic Programming | 8 | 11-22-2006 01:01 PM |
All times are GMT -5. The time now is 08:15 AM.
Amrosama.cc
Arekbulski.cc
Debtboy.cc
Guest.cc
Jaan.cc
James.cc
Mathx.cc
Tsz.cc
Vswe.cc