Learnerslesson
   JAVA   
  SPRING  
  SPRINGBOOT  
 HIBERNATE 
  HADOOP  
   HIVE   
   ALGORITHMS   
   PYTHON   
   GO   
   KOTLIN   
   C#   
   RUBY   
   C++   




zfill( ) FUNCTION


zfill( ) Function


The zfill( ) Function is used to fill the left side of the String with 0's until the complete space is filled.


Example :


x = "Hello"
y = x.zfill(10)
print(y)


Output :



  00000Hello

In the above code, we have declared a String 'Hello'.


x = "Hello"

Then we have used the 'x.zfill(10)' function to allocate '10' blocks. Then fill the left side with five '0's shifting the String 'Hello' to the right.


y = x.zfill(10)

java_Collections