var RobotName
Created at 13 Nov 2012, 01:27
var RobotName
13 Nov 2012, 01:27
Hello,
How can I put...
1, the name of the robot "Test" (public class Test : Robot) into a variable?
2, and the file name of the robot (..\Robots\Test.algo) into a variable? (with / without extension)
var RobotName = ????
Thanks for your help!
admin
14 Nov 2012, 11:44
You may do it this way:
private string GetClassName()
{
var name = GetType().ToString(); // returns cAlgo.Robot.ClassName
return name.Substring(name.LastIndexOf('.') + 1); // returns ClassName
}
@admin