logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

copy-string - (strings)

Description

Use copy-string to copy <source string> to <dest string>. <start with> number (in "start-with" clause) is the position in <source string> to start copying from, with 0 being the first byte. Without "length" clause, the whole of <source string> is copied. With "length" clause, exactly <length> bytes are copied into <dest string>. You can copy a string to itself. In this case, the original string remains and the new string references a copy: set-string str = "original string" // string to change set-string orig = str // references original copy of the string to change copy-string str to str // make a copy of string to change and assign it to itself upper-string str // change the copy // Now "str" references "ORIGINAL STRING" // and "orig" references "original string"

Examples

After copy-string below, "my_str" will be a copy of string "some value": set-string other_string="some value" copy-string other_string to my_str Copy certain number of bytes, the result in "my_str" will be "ome": set-string other_string="some value" copy-string other_string to my_str length 3 start-with 1

Name

copy-string - (strings)

Purpose

Copies string to another string.

See Also

Strings concatenate-stringscopy-stringcount-substringdelete-stringlower-stringnew-stringread-splitreplace-stringset-stringsplit-stringstring-lengthtrim-stringupper-stringwrite-string See all documentation $DATE $VERSION GOLF(2gg)

Syntax

copy-string <source string> to <dest string> \ [ start-with <start with> ] \ [ length <length> ]

See Also