. Math.ABS, , . , , , , .
Dim number As Integer = -107
Dim result As String
Dim numberFromLeft As Integer = 2
result = Math.Abs(number).ToString.Substring(0, numberFromLeft)
This results in 10, this is a string, but converting it back to a number is easy if you need to. If you need to keep track of whether it was positive or negative, you could use the original value to apply this return line to your collapsible line.
source
share