/
aprogrammer
/
dotnet-docs
Обзор
Документация
Войти
/
aprogrammer
/
dotnet-docs
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
samples/snippets/visualbasic/VS_Snippets_CLR/RegularExpressions.Examples.StripChars/vb/Example.vb
19 строк
540 B
Next Turn
Format codes based on .editorconfig, Part 7 (#18887)
11 июн 2020, 15:38
Не верифицирован
11 июн 2020, 15:38
783654b
Код
Авторство
О чём код?
' Visual Basic .NET Document Option Strict On ' <Snippet1> Imports System.Text.RegularExpressions Module Example Function CleanInput(strIn As String) As String ' Replace invalid characters with empty strings. Try Return Regex.Replace(strIn, "[^\w\.@-]", "") ' If we timeout when replacing invalid characters, ' we should return String.Empty. Catch e As RegexMatchTimeoutException Return String.Empty End Try End Function End Module ' </Snippet1>