I'm having this string in my app which stores different percentage, I want to just extract the percentage value and convert it to int( ). My String looks something like this..
note: there will be one or more blank space(s) before the number.
result ='bFilesystem Size Used Avail Use% Mounted on\n/dev/sda4 30G 20G 8.4G 71% /\n'
percentage = getPercentage(result) #This method should output 71 in this example
print("Percentage is: ", percentage)
Thank you in advance.