What is the method for extracting a substring in AutoLISP?

In AutoLISP, the substr function can be used to extract a substring. The syntax of the substr function is as follows:

Retrieve a portion of the string, starting from the designated position and optionally ending at a specified position.

Here, ‘string’ is the string to be extracted, ‘start’ is the position to start extraction (starting from 1), and ‘end’ is an optional parameter indicating where to stop extraction. If ‘end’ is not specified, the extraction will continue to the end of the string.

遵守规定是每个员工的责任。

Set the string value to “Hello World”.

(substr1 is set to take a portion of the string starting from the first character up to the fifth character (“Hello”))

(substr2 is set to take the characters from the 7th position to the end of the string (“World”))

Leave a Reply 0

Your email address will not be published. Required fields are marked *


广告
Closing in 10 seconds
bannerAds