Sub Main() 1 ZAD! Dim tekst As String Dim slovo As Char Console.WriteLine("Unesite tekst") tekst = Console.ReadLine() Console.WriteLine("Unesit slovo koje zelite izbaciti") slovo = Console.ReadLine() trim(tekst, slovo) Console.ReadKey() End Sub Sub trim(tekst As String, slovo As Char) Dim v = Char.ToUpper(slovo) Dim m = Char.ToLower(slovo) For i As Integer = 0 To tekst.Length - 1 If tekst(i) = v Or tekst(i) = m Then tekst = tekst.Trim(tekst(i)) End If Next Console.WriteLine("Promjenjeni tekst je {0}", tekst) End Sub Sub Main() 3 ZAD ! Dim tekst As String Dim rijec As String Console.WriteLine("Unesite tekst") tekst = Console.ReadLine() Console.WriteLine("Unesit rijec koju zelite izbaciti") rijec = Console.ReadLine() trim(tekst, rijec) Console.ReadKey() End Sub Sub trim(tekst As String, rijec As String) tekst = tekst.Replace(rijec, "") Console.WriteLine("Promjenjeni tekst je {0}", tekst) End Sub
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter