Skip to content

Commit a4dc82b

Browse files
authored
Update 661-language-use.markdown
1 parent dd633fe commit a4dc82b

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed
Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
11
# USE
22

3-
> USE
3+
> USE expr
44
5-
Used with various commands for passing a user-defined expression. eg `SPLIT s," ",v USE TRIM(x)`. Trim each element of v.
5+
Used with various commands for passing a user-defined expression `expr`.
66

7+
### Example: Split
78

9+
```
10+
s = "/etc/temp/filename1.ext " ' additional spaces at the end of the string
11+
SPLIT s, "/", v, "temp" USE TRIM(x) ' trim(x) will remove spaces at the beginning
12+
' and the end of the splitted strings;
13+
' try the example without "USE TRIM(x)"
14+
FOR i = 0 TO UBOUND(v)
15+
PRINT i;" [";v(i);"]"
16+
NEXT
17+
18+
' displays
19+
' 0 []
20+
' 1 [etc/temp]
21+
' 2 [filename1.ext]
22+
```

0 commit comments

Comments
 (0)