NicifyVariableName(string)
Make a displayable name for a variable.
Read time 1 minuteLast updated 12 days ago
Definition
- Type: Method
- Namespace: UnityEditor
- Assembly: UnityEditor.CoreModule
public static string NicifyVariableName(string name)
Parameters
Returns
Type | Description |
|---|---|
| string |
Remarks
This function will insert spaces before capital letters and remove optional , or followed by uppercase letter in front of the name.
m__kExamples
using UnityEngine;using UnityEditor;public class Example : MonoBehaviour{ private void Start() { // prints "My Variable" print(ObjectNames.NicifyVariableName("MyVariable")); // prints "The Other Variable" print(ObjectNames.NicifyVariableName("m_TheOtherVariable")); // prints "Some Constant" print(ObjectNames.NicifyVariableName("kSomeConstant")); }}