coffescript

In this case I want to show the method wich a created because I need to convert in camel case format "DebitCard" into  snake case (underscore) format "debit_card" and here you can find what I did: Coffeescript [javascript] snakeCase: (clazz)-> unless clazz is '' or clazz is undefined clazz.replace /([A-Z])/g, ($1) -> if clazz.charAt(0) is $1 $1.toLowerCase() else "_" + $1.toLowerCase() [/javascript]