Query_Lang-SystemFunctions_System_CopyCopy_AD

Now reading version 19. For the latest, read: Query_Lang-SystemFunctions_System_Copy((Copy))_AD for version 21

Parent page: System Query Functions - System Functions

Summary

Returns a substring of a string. It is possible to specify how many characters will be within the substring returned, and the location within the string which will be the first character of the substring returned.

Syntax

Copy(S : String , Index : Integer , Count : Integer) : String

S is a string-type expression. Index and Count are integer-type expressions. Copy returns a substring containing Count characters starting at S[Index].

If Index is larger than the length of S, Copy returns an empty string.

If Count specifies more characters than are available, only the characters from S[Index] to the end of S are returned.

Example Usage

Copy('Cats and dogs',1,1)
Returns 'C'. (Return 1 character, from the 1st location within the string).

Copy('Cats and dogs',2,1)
Returns 'a'. (Return 1 character, from the 2nd location within the string).

Copy('Cats and dogs',13,1)
Returns 's'. (Return 1 character, from the 13th location within the string).

Copy('Cats and dogs',14,1)
Returns '' (an empty string). (Return 1 character, from the 14th location within the string; however, there are only 13 characters within the string, so an empty string is returned).

Copy('Cats and dogs',1,2)
Returns 'Ca'. (Return 2 characters, starting from the 1st location within the string).

Copy('Cats and dogs',2,2)
Returns 'at'. (Return 2 characters, starting from the 2nd location within the string).

Copy('Cats and dogs',12,2)
Returns 'gs'. (Return 2 characters, starting from the 12th location within the string).

Copy('Cats and dogs',13,2)
Returns 's'. (Return 2 characters, starting from the 13th location within the string; however, there are only 13 characters within the string, so only 1 character gets returned).

Copy('Cats and dogs',15,2)
Returns '' (an empty string). (Return 2 characters, starting from the 15th location within the string; however, there are only 13 characters within the string, so an empty string gets returned).

Copy('Cats and dogs',1,6)
Returns 'Cats a'. (Return 6 characters, starting from the 1st location within the string).

Copy('Cats and dogs',5,9)
Returns ' and dogs'. (Return 9 characters, starting from the 5th location within the string).

Copy('Cats and dogs',8,5)
Returns 'd dog'. (Return 5 characters, starting from the 8th location within the string).

Copy('Cats and dogs',8,6)
Returns 'd dogs'. (Return 6 characters, starting from the 8th location within the string).

Copy('Cats and dogs',8,7)
Returns 'd dogs'. (Return 7 characters, starting from the 8th location within the string; however, there are only 13 characters within the string, so only 6 characters get returned).

 

If you find an issue, select the text/image and pressCtrl + Enterto send us your feedback.
참고

Altium 제품에 접근할 수 있는 레벨에 따라 사용할 수 있는 기능이 달라집니다. 다양한 레벨의 Altium Designer Software Subscription에 포함된 기능과 Altium 365 플랫폼에서 제공하는 애플리케이션을 통해 제공되는 기능을 비교해보세요.

소프트웨어에서 논의된 기능을 찾을 수 없는 경우, Altium 영업팀에 문의하여 자세한 정보를 확인해주세요.