You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
311 B
18 lines
311 B
# String operations which don't require allocation
|
|
import micropython
|
|
|
|
micropython.heap_lock()
|
|
|
|
# Concatenating empty string returns original string
|
|
b"" + b""
|
|
b"" + b"1"
|
|
b"2" + b""
|
|
|
|
"" + ""
|
|
"" + "1"
|
|
"2" + ""
|
|
|
|
# If no replacements done, returns original string
|
|
"foo".replace(",", "_")
|
|
|
|
micropython.heap_unlock()
|
|
|