summaryrefslogtreecommitdiff
path: root/comp/lucas-standen-NEA/code2/examples/str_example.zpy
diff options
context:
space:
mode:
authorthing1 <thing1@seacrossedlovers.xyz>2024-10-01 08:55:32 +0100
committerthing1 <thing1@seacrossedlovers.xyz>2024-10-01 08:55:32 +0100
commitef8cf00bbf9f74eb3b6aabc1d99f5358e81741c7 (patch)
tree3479ca1b82573426151cb270c63a588af737d3c0 /comp/lucas-standen-NEA/code2/examples/str_example.zpy
parentdc7732b6f073d5450657d94c815ca445a1a08fbd (diff)
added some cool examples to zpy and got electronics working
Diffstat (limited to 'comp/lucas-standen-NEA/code2/examples/str_example.zpy')
-rw-r--r--comp/lucas-standen-NEA/code2/examples/str_example.zpy14
1 files changed, 11 insertions, 3 deletions
diff --git a/comp/lucas-standen-NEA/code2/examples/str_example.zpy b/comp/lucas-standen-NEA/code2/examples/str_example.zpy
index 7311660..bffc3f0 100644
--- a/comp/lucas-standen-NEA/code2/examples/str_example.zpy
+++ b/comp/lucas-standen-NEA/code2/examples/str_example.zpy
@@ -1,6 +1,14 @@
(defun main int)
- (let str:string* (String "hello"))
- (printchar str->_str[0])
+ (let str:string* (String "hello_world"))
+ (printstr str->_str)
+ (printchar '\n')
+
+ (let strs:string** (str->split str '_'))
+
+ (printstr strs[0]->_str)
+ (printchar '\n')
+ (printstr strs[1]->_str)
+ (printchar '\n')
+
(str->free str)
- (printstr "<first_letter\n")
(endfun)