Click or drag to resize

StringUtilsToSymbol Method (String)

Converts a string to a symbol string by removing all characters except for a-z, A-Z, 0-9, and "_". The result is a string suitable for an identifier in HTML or elsewhere.

Namespace:  NetQuarry
Assembly:  EAP.Core (in EAP.Core.dll) Version: 2.0.0.0 (4.6.8.0)
Syntax
public static string ToSymbol(
	string s
)

Parameters

s
Type: SystemString
The string to convert.

Return Value

Type: String
The symbol with offending characters removed.
Remarks
Note that "_" is not quite accurate. Actually the RegEx "\w" word character is used which, in addition to alphanumerics, allows Pc (any Unicode Characters in the 'Punctuation, Connector' Category). The only common such character in English is the underbar ("_"), but there are a number of other uncommon connectors allowed.
See Also