Skip to content

Commit

Permalink
add string splicing
Browse files Browse the repository at this point in the history
  • Loading branch information
daedalus committed May 24, 2024
1 parent 97d2260 commit b5a2898
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions splice.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import sys
if len(sys.argv) == 1:
print('usage: <"string"< <offset> <length>')
else:
string = sys.argv[1]
offset = int(sys.argv[2])
length = int(sys.argv[3])
print(string[offset: offset + length])

0 comments on commit b5a2898

Please sign in to comment.