StringUtilsToSymbol Method (String, String) |
Converts a string to a symbol string by replacing all characters except for a-z, A-Z, 0-9, and "_"
with the specified replacement character (or string, really).
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,
string replacement
)
Public Shared Function ToSymbol (
s As String,
replacement As String
) As String
Parameters
- s
- Type: SystemString
The string to convert. - replacement
- Type: SystemString
The character with which to replace offending characters.
Return Value
Type:
StringThe symbol with offending characters replaced.
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