简体   繁体   中英

How can copy 4 character from begining of string to end of string?

For example:

var
s:string;
begin
s:='Hello1234567';

end;
end.

How can I copy from string 4 byte 4 byte..Example showmessage('hell') and showmessage('o123') and showmessage('4567')?

Use the Copy() function for that:

var
  s: string;
begin
  s := 'Hello1234567';
  ShowMessage(Copy(s, 1, 4));
  ShowMessage(Copy(s, 5, 4));
  ShowMessage(Copy(s, 9, 4));
end;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM