Please could someone convert the code below for me?
I need to convert VBA to Python
=================================================================================
I need to convert VBA to Python
=================================================================================
Public Function Clean_Text(main_text As String, _ cut_1 As String, _ cut_2 As String) Application.ScreenUpdating = False Dim x As String Dim begin As String Dim end As String x = main_text Do While InStr(1, x, cut_1) > 0 begin = InStr(1, x, cut_1) end = InStr(1, x, cut_2) x = Replace(x, Mid(x, begin, end - begin + Len(cut_2)), "") Loop Clean_Text = x End Function=================================================================================