Skip to content

Instantly share code, notes, and snippets.

@msztolcman
Created August 5, 2013 21:44
Show Gist options
  • Save msztolcman/6159881 to your computer and use it in GitHub Desktop.
Save msztolcman/6159881 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python -tt
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
import os, os.path
import sys
import re
from pprint import pprint, pformat
var = 'hello world'
print('|', var[var.index('world'):], '|', sep='')
print('|', var[:var.index('world')], '|', sep='')
# |world|
# |hello |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment