Skip to content

isValidCSharpIdentifier

Checks whether the provided name is a valid C# identifier (without @ prefix). Does not account for keyword conflicts — use isCSharpKeyword for that.

import { isValidCSharpIdentifier } from "@alloy-js/csharp";
function isValidCSharpIdentifier(name: string): boolean;
namestring

boolean true if the name matches C# identifier rules (letter or underscore start, word chars after).