Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub Main()
- Dim HoraEmString As String = "234"
- Dim HoraEmArray() As Char = HoraEmString.ToCharArray
- Dim Minutos() As Char
- Dim Hora() As Char
- Minutos = {HoraEmArray(HoraEmArray.GetUpperBound(HoraEmArray.Rank - 1) - 1), HoraEmArray(HoraEmArray.GetUpperBound(HoraEmArray.Rank - 1))}
- If (HoraEmArray.Count - 2).Equals(1) Then
- Hora = {"0", HoraEmArray(HoraEmArray.GetLowerBound(HoraEmArray.Rank - 1))}
- Else
- Hora = {HoraEmArray(HoraEmArray.GetLowerBound(HoraEmArray.Rank - 1)), HoraEmArray(HoraEmArray.GetLowerBound(HoraEmArray.Rank - 1) + 1)}
- End If
- Dim HoraFormatada As String
- HoraFormatada = String.Join(":", Hora, Minutos)
- Console.WriteLine(Minutos)
- Console.WriteLine(Hora)
- Console.WriteLine(HoraFormatada)
- Console.ReadKey()
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement