I run the PowerShell command to get total RAM capacity using C# and it returns this value. @{TotalPhysicalMemory= 17856325}
. I wrote a code to get the only integer value. This is the code.
string ramSize = "@{TotalPhysicalMemory= 17856325}";
string ramValue = ramSize.Split('=')[1].Split('}')[0].Trim().ToString();
This code returns the integer value. But I want to know are there any ways to get this integer value easily?