Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
Copy |
unit |
| System | |
| category | |
| string handling routines |
| declaration |
function Copy(S; Index, Count: Integer): array;
| description |
S is an expression of a string or dynamic-array type. Index and Count are integer-type expressions. Copy returns a string containing a specified number of characters from a string or sub array containing Count elements starting at S[Index].
If Index is greater than the length of S, Copy returns a zero-length string ("") or an empty array.
If Count specifies more characters or array elements than are available, only the characters or elements from S[Index] to the end of S are returned.
To determine the number of characters in string, use the Length function. A convenient way to copy all the elements of S from the starting Index is to use MaxInt as Count.
| example |
var s : string; s:='DELPHI'; s := Copy(s,2,3); //s='ELP'; |
| in real code |
Understanding and managing string data types in Delphi's Object Pascal. Learn about differences between Short, Long, Wide and null-terminated strings.
Arrays in Object Pascal
Understanding and using array data types in Delphi.
Traveling Label
Spice up your user interface with a marquee style text. Use marquee style text to display scrolling text that you want to catch your Delphi program users' attention.
| see also |

