Forum Discussion
Error with Text.Trim
Yes, even combinations. So if the string ends with "...!!!??", you can use trimList={".","!","?"} and it should remove all of them. If it doesn't, as I noted in your first tweet example above, it is because the character entered in trimList is different from the character actually there.
Your first line looks like it ends with "â€". However, it actually ends with "â€" where the very last character is code 157, and the pound sign, instead of being code 128, is actually a unicode character number 8364 (an HTML code). So you would have to include the codes for all of those particular characters in order to trim them off the end. Otherwise it will stop trimming at the first character from the end it encounters that is not in the trimList.
ronrsnfld
I had postulated that the issue was with HTML code, I am not a coder so I was looking for lists of HTML etc. to try and think up a scalable list to use to remove all of this from the tweets.
That is a very good point and has helped me to find more of a resolve and understand the M language and using more advanced query editor usage. Thank you for your reply.
- ronrsnfld3 years agoSuper User
In your trimList, you can include Character.FromNumber to generate the "strange" codes.
- AlexisOlson3 years agoSuper User
Another potential approach would select only the characters that you want to keep and throw everything else away.