For details about how to use the just ust () method in Python, pythonjust UST
Returns the right-side length and width of a string. Fill is done by using the specified fillchar (space by default ). If the width is less than len (s), the original string is returned.
Syntax
The syntax of the just ust () method is as follows:
Str. Fill ust (width [, fillchar])
Parameters
- Width -- this is the total length after the string is filled.
- Fillchar -- this is a fill character. The default value is space.
Return Value
This method returns the right-side length and width of a string. Fill is done by using the specified fillchar (space by default ). If the width is less than len (s), the original string is returned.
Example
The following example shows how to use the just ust () method.
#! /Usr/bin/pythonstr = "this is string example... wow !!! "; Print str. Must ust (50, '0 ');
When we run the above program, it will produce the following results:
000000000000000000 this is string example... wow !!! Str1 = "this is string example... wow !!! "; Str2 =" is "; print str1.rindex (str2); print str1.index (str2 );
When we run the above program, it will produce the following results:
52