MakeValidName() публичный статический Метод

Force a name to be valid by replacing invalid characters with a fixed value
public static MakeValidName ( string name, char replacement ) : string
name string The name to make valid
replacement char The replacement character to use for any invalid characters.
Результат string
Пример #1
0
 // Token: 0x060008FD RID: 2301 RVA: 0x00032FFC File Offset: 0x000311FC
 public string TransformFile(string name)
 {
     if (name != null)
     {
         name = WindowsNameTransform.MakeValidName(name, this._replacementChar);
         if (this._trimIncomingPaths)
         {
             name = Path.GetFileName(name);
         }
         if (this._baseDirectory != null)
         {
             name = Path.Combine(this._baseDirectory, name);
         }
     }
     else
     {
         name = string.Empty;
     }
     return(name);
 }
Пример #2
0
 // Token: 0x060008FE RID: 2302 RVA: 0x0003304C File Offset: 0x0003124C
 public static bool IsValidName(string name)
 {
     return(name != null && name.Length <= 260 && string.Compare(name, WindowsNameTransform.MakeValidName(name, '_')) == 0);
 }