src/Azos/Text/DataEntryUtils.cs
/// <summary>
/// Allows only safe characters and digits replacing characters that may be used in SQL injection.
/// This method may be used to generate column names from entity IDs
/// </summary>
Allows only safe characters and digits replacing characters that may be used in SQL injection.
This method may be used to generate column names from entity IDs
Allows only safe characters and digits replacing characters that may be used in SQL injection . This method may be used to generate column names from entity IDs
public static string SQLSafeSubstitute(string str, char subst = ' ')
    {
      if (str.IsNullOrWhiteSpace()) return null;
      var result = new StringBuilder();
      foreach (var c in str)
      {
        if (IsValidScreenNameLetterOrDigit(c) || (c == '-') || (c == '_') || (c == ' '))
          result.Append(c);
        else
          result.Append(subst);
      }
      return result.ToString();
    }
public static string SQLSafeSubstitute ( string str , char subst = ' ' ) { if ( str . IsNullOrWhiteSpace ( ) ) return null ; var result = new StringBuilder ( ) ; foreach ( var c in str ) { if ( IsValidScreenNameLetterOrDigit ( c ) || ( c == ' ' ) || ( c == ' ' ) || ( c == ' ' ) ) result . Append ( c ) ; else result . Append ( subst ) ; } return result . ToString ( ) ; }
Allows only safe characters and digits replacing characters that may be used in SQL injection.
Allows only safe characters and digits replacing characters that may be used in SQL injection .
str
string
subst
char