diff options
author | Nishanth Amuluru | 2010-10-12 10:53:33 +0530 |
---|---|---|
committer | Nishanth Amuluru | 2010-10-12 10:53:33 +0530 |
commit | 6e7ee8c0ee453b36c50a707bb781df23c382458f (patch) | |
tree | ca9036c8645ad8cb4c66f3629a6e60c787892568 | |
parent | 9cffa0a600ba51e9581a801bd05f3afe1ae9dc6f (diff) | |
download | st-scripts-6e7ee8c0ee453b36c50a707bb781df23c382458f.tar.gz st-scripts-6e7ee8c0ee453b36c50a707bb781df23c382458f.tar.bz2 st-scripts-6e7ee8c0ee453b36c50a707bb781df23c382458f.zip |
Finished parsing_data
-rw-r--r-- | parsing_data/quickref.tex | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/parsing_data/quickref.tex b/parsing_data/quickref.tex index a0212b3..5adaa84 100644 --- a/parsing_data/quickref.tex +++ b/parsing_data/quickref.tex @@ -1,11 +1,15 @@ -Creating a tuple:\\ -{\ex \lstinline| t = (1, "hello", 2.5)|} +Splitting a string on whitespace:\\ +{\ex \lstinline| str_var.split()|} -Accessing elements of tuples:\\ -{\ex \lstinline| t[index] Ex: t[2]|} +Splitting a string using a delimiter. Ex: ";" :\\ +{\ex \lstinline| str_var.split(";")|} -Accessing slices of tuples:\\ -{\ex \lstinline| t[start:stop:step]|} +Stripping the whitespace around a string:\\ +{\ex \lstinline| str_var.strip()|} + +Converting a string or float to int:\\ +{\ex \lstinline| int(var_name)|} + +Converting a string or int into float:\\ +{\ex \lstinline| float(var_name)|} -Swapping values:\\ -{\ex \lstinline| a, b = b, a|} |