Go to: Synopsis. Return value. Related. MEL examples.

Synopsis

int isValidObjectName(string $name)

Return true if the string is a valid object name. A valid object name begins with a letter and is followed letters, digits, or underscores. Spaces are not allowed.

Return value

None

Related

isValidObjectName, isValidString

Arguments

Variable Name Variable Type Description
$namestringThe name string to test.

MEL examples

	isValidObjectName("Name"); // Will succeed.


	isValidObjectName(" Name"); // Will fail.


	isValidObjectName("1 Name"); // Will fail.


	isValidObjectName("New Name"); // Will fail.


	isValidObjectName("New_Name"); // Will succeed.


	isValidObjectName("New Name 1"); // Will fail.