Oct-03-2021, 12:15 PM
Hello, can someone please explain why when I select a range starting from the end of a string it truncates the last character?
I can work from the front end as variable dst will always be the same length but when faced with an unknown string length it would be an issue
I can work from the front end as variable dst will always be the same length but when faced with an unknown string length it would be an issue
dst = (r"C:\Users\tekno\Documents\Client Drawings\AAA001") dwg_name = (dst[-7:-1]) print(dst) print(dwg_name) print(dst[40:47]) print(dst[-7:-1]) print(dst[-1])
Output:C:\Users\tekno\Documents\Client Drawings\AAA001
\AAA00
\AAA001
\AAA00
1