/
aprogrammer
/
dotnet-docs
Обзор
Документация
Войти
/
aprogrammer
/
dotnet-docs
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
docs/core/deploying/snippets/deploy-with-vs/vb/deployment-example.vb
29 строк
1 KB
Youssef Victor
Create proj files and move deploy snippets (#18455)
18 май 2020, 19:01
Не верифицирован
18 май 2020, 19:01
c07155f
Код
Авторство
О чём код?
Imports System.Text.RegularExpressions Namespace Applications.ConsoleApps Public Module ConsoleParser Public Sub Main() Console.WriteLine("Enter any text, followed by <Enter>:") Console.WriteLine() Dim s = Console.ReadLine() ShowWords(s) Console.Write($"{vbCrLf}Press any key to continue... ") Console.ReadKey() End Sub Private Sub ShowWords(s As String) Dim pattern = "\w+" Dim matches = Regex.Matches(s, pattern) Console.WriteLine() If matches.Count = 0 Then Console.WriteLine("No words were identified in your input.") Else Console.WriteLine($"There are {matches.Count} words in your string:") For ctr = 0 To matches.Count - 1 Console.WriteLine($" #{ctr,2}: '{matches(ctr).Value}' at position {matches(ctr).Index}") Next End If Console.WriteLine() End Sub End Module End Namespace