Python has no substring methods like python substring() or substr(). Instead, you can use slice syntax to get parts of existing strings. Python slicing is a computationally fast way to methodically access parts of your data. The colons (:) in subscript notation make slice notation - which has the arguments, start, stop and step . It follows this template:
Parameters are enclosed in the square brackets.
Parameters are separated by colon.
string[start: end: step]
start - Starting index of string, Default is 0.
end - End index of string which is not inclusive .
step - An integer number specifying the step of the slicing. Default is 1.
However, if you go through the article I am not trying to explain how to extract sub-string from a string but how to search a specific sub-string from a string. You can try to read the article well to get the message. Thanks for your contribution
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Python has no substring methods like python substring() or substr(). Instead, you can use slice syntax to get parts of existing strings. Python slicing is a computationally fast way to methodically access parts of your data. The colons (:) in subscript notation make slice notation - which has the arguments, start, stop and step . It follows this template:
Parameters are enclosed in the square brackets.
Parameters are separated by colon.
string[start: end: step]
start - Starting index of string, Default is 0.
end - End index of string which is not inclusive .
step - An integer number specifying the step of the slicing. Default is 1.
net-informations.com/python/basics...
Thank you very kindly for your observation I really appreciate.
However, if you go through the article I am not trying to explain how to extract sub-string from a string but how to search a specific sub-string from a string. You can try to read the article well to get the message. Thanks for your contribution