浏览代码

Fixed a bug where capitalize didn't work with camelCase names

Will Nations 7 年之前
父节点
当前提交
238d488a04
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      core/ustring.cpp

+ 1 - 1
core/ustring.cpp

@@ -564,7 +564,7 @@ void String::erase(int p_pos, int p_chars) {
 
 String String::capitalize() const {
 
-	String aux = this->replace("_", " ").to_lower();
+	String aux = this->camelcase_to_underscore(true).replace("_", " ").strip_edges();
 	String cap;
 	for (int i = 0; i < aux.get_slice_count(" "); i++) {