Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text;
- public static class Identifier
- {
- public static string Clean(string identifier)
- {
- StringBuilder sbIdentifier = new StringBuilder();
- for (int i = 0;i < identifier.Length; i++)
- {
- if (identifier[i] == ' ')
- {
- sbIdentifier.Insert(i, '_');
- Console.WriteLine("SPACE");
- }
- else if (Char.IsControl(identifier, i))
- {
- sbIdentifier.Insert(i, "CTRL");
- Console.WriteLine("IsControl");
- }
- else
- {
- sbIdentifier.Insert(i, identifier[i]);
- Console.WriteLine("NOT NULL");
- }
- }
- return sbIdentifier.ToString();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement