excel_name[:16] how to change strip method to according to a character
时间: 2024-03-26 21:42:14 浏览: 62
pandas read_excel()和to_excel()函数解析
To strip a string according to a specific character, you can use the `split()` method to split the string into a list of substrings based on that character, and then select the desired substring using indexing. For example, to extract the substring before the first occurrence of the underscore character (`_`), you can do:
```
excel_name.split('_')[0]
```
This will split the `excel_name` string into a list of substrings based on the underscore character, and then select the first substring (index 0) as the result.
阅读全文