3.7.0 3.6.0 3.5.0 3.4.0 3.3.0 3.2.2 3.2.1 3.2.0 Korean English Chinese Czech Dutch French German Hungarian Italian Japanese Polish Portuguese Spanish
3.7.0 3.6.0 3.5.0 3.4.0 3.3.0 3.2.2 3.2.1 3.2.0 Korean English Chinese Czech Dutch French German Hungarian Italian Japanese Polish Portuguese Spanish

String

String

Features

All character strings are in Unicode.

  • Escape characters
    \n: New line
    \t: Tab
    \r: Carrage return
    \0: Null string
    \\: back slash(\) in string
    \’: single quote mark in string
    \": double quote mark in string

  • String concatenation: "py"+ "tyon" → "python"

  • String repeatition: "py"* 3 → "pypypy"

  • String indexing: "python" [0] → "p"

  • String slicing: "python" [1:4] → "yth"

Example

Python
"string1"
'string2'

tp_log("st"+"ring")
	#expected result: string
tp_log("str"* 3)
	#expected result: strstrstr
tp_log("line1\nline2")
	#expected result: line1
	# line2
tp_log("\"string\"")
	#expected result: "string"
tp_log("str"[0])
	#expected result: s
tp_log("string"[1:3])
	#expected result: tr


+, *

Example

Python
"Doosan"+ "Robotics" → "DoosanRobotics"
"Doo"* 3 → "DooDooDoo"


Indexing & slicing

Example

Python
" Doosan" [0] → "D"
" Doosan" [1:4] → "oos"