summaryrefslogtreecommitdiff
path: root/docs/examples/tutorial/string
diff options
context:
space:
mode:
authorgabrieldemarmiesse <gabriel.demarmiesse@teraki.com>2018-06-21 14:47:55 +0200
committergabrieldemarmiesse <gabriel.demarmiesse@teraki.com>2018-06-21 14:47:55 +0200
commit9be024dc35977168f907b2fc50b327cfc7ad850b (patch)
tree6c9ee8a12f5185769cb29e6168d1cc7b3c71e3b1 /docs/examples/tutorial/string
parent047809103580445f4dae65bb8c646dcd52231a10 (diff)
downloadcython-9be024dc35977168f907b2fc50b327cfc7ad850b.tar.gz
Moved an example of for loop with char* to the examples directory.
Diffstat (limited to 'docs/examples/tutorial/string')
-rw-r--r--docs/examples/tutorial/string/for_char.pyx6
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/examples/tutorial/string/for_char.pyx b/docs/examples/tutorial/string/for_char.pyx
new file mode 100644
index 000000000..1de615ad1
--- /dev/null
+++ b/docs/examples/tutorial/string/for_char.pyx
@@ -0,0 +1,6 @@
+cdef char* c_string = "Hello world"
+
+cdef char c
+for c in c_string[:11]:
+ if c == 'A':
+ print("Found the letter A")