i came up with this. Hope this will help someone who is looking for same function
B4X:
Sub ucfirst(str As String) As String
str = str.ToLowerCase
Try
Dim Length = str.Length As Int
Dim firstchar = str.SubString2(0,1).ToUpperCase As String
Return firstchar & str.SubString2(1, Length - 1)
Catch
Return str
End Try
End Sub
And I modified NJDude's function to fit my need (Thanks NJDude)
B4X:
Sub PadNZeros(num As String, Length As Int) As String
Dim Padding As String
Length = Abs(Length)
For I = 0 To Length
Padding = Padding & "0"
Next
num = Padding & num
num = num.SubString2(num.Length - Length, num.Length)
Return num
End Sub