Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 07-20-2018, 05:16 PM
FreakaZoid2 FreakaZoid2 is offline
Senior Member
 
Join Date: Jul 2009
Posts: 330
Default String character change. (no replacestring)

i have a stringlist of lines of text.
i want to change the 43rd character in the string.
i have it working this way BUT wanted to know if there is a better function/option.
.....
astring := _strlist[i];
astring[43] := '3';
_strlist[i] := astring;
......
i tried to cast but get compile error left side cannot be assigned to
......
string(_strlist[i])[43] := '3';
......
just wanting to learn something new if possible...
Reply With Quote
  #2  
Old 07-21-2018, 09:37 AM
Marsheng Marsheng is offline
Senior Member
 
Join Date: Nov 2008
Posts: 313
Default

_strlist[i]:=copy(_strlist[i],1,43)+'3'+copy(_strlist[i],45,length(_strlist[i])

Not tested but should be correct.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 08:52 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2018, vBulletin Solutions, Inc.