Answers for "add leading zeros in tostring"

1

replace 2 leading zeros from string

String str = "00051700";
String strPattern = "^0+";        
System.out.println( "String: " + str.replaceAll(strPattern, "") );
Posted by: Guest on May-21-2020
1

how to append leading zeros in python

str.zfill(width)
Posted by: Guest on July-12-2020

Python Answers by Framework

Browse Popular Code Answers by Language