remove all zeros at the end of array code example Example: remove zeroes from beginning and end a_string = a_string.strip("0")