# (substr string start \[length\])
[GstarCAD 2012](../../../Index.md) → [Developer Reference](../../%28Developer%20Reference%29.md) → [AutoLISP Reference](../%28AutoLISP%20Reference%29.md) → [LISP Functions](%28LISP%20Functions%29.md)
<!-- help-structure:notice -->
> **Source status:** This source topic has 1 recorded inherited issue(s). [Source issue details](../../../Source%20Issues.md).
<!-- /help-structure:notice -->
<a id="287"></a>
## (substr string start \[length\])
---
Give me part of that string.
---
This function takes apart strings. It takes out a sub-string from the original string, which you can then assign to a variable or use as any other string.
The argument *start* indicates which character in the string to start from. Unlike other functions that deal with elements of a list, **substr** considers the first character in the string as number one (not #0). When the start position is greater than the length of the string**, substr** returns "" (non-nil).
The *length* argument represents the number of characters to include in the sub-string; this value must be a positive [integer](../../../Source%20Issues.md#issue-0e0dc4ae660ee7ea). If this argument is not provided, the sub-string extends to the end of the original string. When the integer is larger than the number of characters available, the entire list from the specified first character to the end will be returned with no error.
### Examples
| Code | Returns |
| --- | --- |
| (**substr** "California" 4 3 ) | "ifo" |
| (**substr** "Texas" 3 ) | "xas" |
| (**substr** "New Mexico" 12 ) | "" |
**Tell me about...**
[(strcat string1 \[string2\] …)](%28strcat%20string1%20-string2-%20-%29.md)
[(strlen \[string1\] \[string2\] …)](%28strlen%20-string1-%20-string2-%20-%29.md)
[LISP Compatibility](../LISP%20Compatibility.md)
[Programming Overview of LISP (LISt Processing) Language](../Programming%20Overview%20of%20LISP%20%28LISt%20Processing%29%20Language.md)
<a id="holding"></a>
## Other versions with matching text
[GstarCAD 2011](../../../../2011/Developer%20Reference/AutoLISP%20Reference/LISP%20Functions/%28substr%20string%20start%20-length-%29.md)