Skip to content

Instantly share code, notes, and snippets.

@sh4t
Created March 1, 2016 07:20
Show Gist options
  • Save sh4t/820eded6f6b6542e06b2 to your computer and use it in GitHub Desktop.
Save sh4t/820eded6f6b6542e06b2 to your computer and use it in GitHub Desktop.

Revisions

  1. sh4t created this gist Mar 1, 2016.
    19 changes: 19 additions & 0 deletions camel.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    #!/usr/bin/env python
    #encoding: utf-8

    # a modest attempt to not do the work, but to give you some insight.

    somestring = "PrintShitOutandBeAllNiceAndSlow"

    def fuq_camelcase(somestring):
    final = ''
    for item in somestring:
    if item.isupper():
    final += " "+item.lower()
    else:
    final += item
    if final[0] == " ":
    final = final[1:]
    return final

    print fuq_camelcase(somestring)