ExtensionMethod.NET Home of 880 C#, Visual Basic, F# and Javascript extension methods

string to FolderName

Remove caracteres não permitidos para nomes de pastas

Source

<Extension()>
Public Function toPath(conteudo As String) As String
    conteudo = conteudo.Replace("/", "")
    conteudo = conteudo.Replace("\", "")
    conteudo = conteudo.Replace(":", "")
    conteudo = conteudo.Replace("*", "")
    conteudo = conteudo.Replace("?", "")
    conteudo = conteudo.Replace("<", "")
    conteudo = conteudo.Replace(">", "")
    conteudo = conteudo.Replace("|", "")
    Return conteudo
End Function

Example

filename.toPath()

Author: Alex Martins

Submitted on: 13 jan. 2017

Language: VB

Type: string

Views: 3482