Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

get first x characters of string python

characters = 4
string = "This is a string"
print(string[:characters])
#output: 'This'
 
PREVIOUS NEXT
Tagged: #characters #string #python
ADD COMMENT
Topic
Name
6+2 =