📜  如何将字符串统一转换为 int - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:44.250000             🧑  作者: Mango

代码示例1
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Example : MonoBehaviour
{
    int i;+
    string text = "100";
    void Start()
    {
        i = System.Convert.ToInt32(text); // Turns i to 100
    }
}