I encountered such a problem again this time. After searching for a long time, I finally found a good one on the Internet. After looking at the code, the idea was very simple, but there were too many codes and the versatility was not good. So, I invented two more ones. Function, it feels really good to use, I would like to share it with you: