Popular recipes tagged "str"http://code.activestate.com/recipes/tags/str/2009-09-22T20:02:32-07:00ActiveState Code RecipesSimple reverse converter of unicode code points string (Python) 2009-09-22T20:02:32-07:00Ryanhttp://code.activestate.com/recipes/users/4171767/http://code.activestate.com/recipes/576909-simple-reverse-converter-of-unicode-code-points-st/ <p style="color: grey"> Python recipe 576909 by <a href="/recipes/users/4171767/">Ryan</a> (<a href="/recipes/tags/code/">code</a>, <a href="/recipes/tags/points/">points</a>, <a href="/recipes/tags/prefix/">prefix</a>, <a href="/recipes/tags/reverse/">reverse</a>, <a href="/recipes/tags/str/">str</a>, <a href="/recipes/tags/string/">string</a>, <a href="/recipes/tags/u/">u</a>, <a href="/recipes/tags/unicode/">unicode</a>). Revision 4. </p> <p>It's a simple recipe to convert a str type string with pure unicode code point (e.g string = <strong>"\u5982\u679c\u7231"</strong> ) to an unicode type string. Actually, this method has the same effect with <strong>'u'</strong> prefix. But differently, it allows you to pass a variable of code points string as well as a constant one.</p> REAL case insensitive string replace (Python) 2009-04-25T15:48:50-07:00Jonas Haaghttp://code.activestate.com/recipes/users/4169206/http://code.activestate.com/recipes/576715-real-case-insensitive-string-replace/ <p style="color: grey"> Python recipe 576715 by <a href="/recipes/users/4169206/">Jonas Haag</a> (<a href="/recipes/tags/case/">case</a>, <a href="/recipes/tags/case_insensitive/">case_insensitive</a>, <a href="/recipes/tags/replace/">replace</a>, <a href="/recipes/tags/str/">str</a>). Revision 2. </p> <p>REAL case insensitive version of <code>str.replace</code> that keeps the letter case of the original expression (Doesn't only replace <code>Foo</code> and <code>foo</code> to <code>...foo...</code> but to <code>...Foo..</code> and <code>...foo...</code>).</p>