擅长:python、mysql、java
<p>如果可以的话,我喜欢在<code>split</code>上使用<code>partition</code>,因为<code>partition</code>确保返回的每个元组元素都是字符串。在</p>
<pre><code>root_key, _, s = reg.partition("\\")
_, sub_key, property = s.rpartition("\\") # note, _r_partition
</code></pre>