Advertisement
MarceloSousa

Untitled

Jul 15th, 2015
443
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.87 KB | None | 0 0
  1.     Sub Main()
  2.         Dim HoraEmString As String = "234"
  3.         Dim HoraEmArray() As Char = HoraEmString.ToCharArray
  4.         Dim Minutos() As Char
  5.         Dim Hora() As Char
  6.         Minutos = {HoraEmArray(HoraEmArray.GetUpperBound(HoraEmArray.Rank - 1) - 1), HoraEmArray(HoraEmArray.GetUpperBound(HoraEmArray.Rank - 1))}
  7.         If (HoraEmArray.Count - 2).Equals(1) Then
  8.             Hora = {"0", HoraEmArray(HoraEmArray.GetLowerBound(HoraEmArray.Rank - 1))}
  9.         Else
  10.             Hora = {HoraEmArray(HoraEmArray.GetLowerBound(HoraEmArray.Rank - 1)), HoraEmArray(HoraEmArray.GetLowerBound(HoraEmArray.Rank - 1) + 1)}
  11.         End If
  12.  
  13.         Dim HoraFormatada As String
  14.  
  15.         HoraFormatada = String.Join(":", Hora, Minutos)
  16.         Console.WriteLine(Minutos)
  17.         Console.WriteLine(Hora)
  18.         Console.WriteLine(HoraFormatada)
  19.         Console.ReadKey()
  20.     End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement