Forum Discussion
Make Text.Replace Case Insensitive
I want to replace any instance of Ltd, whether it's ltd or LTD or Ltd
I did a simple right click, replace text and have been experimenting with the comparer.orignalignorecase function but unable to determine where to put it:
Here's my formula:
= Table.ReplaceValue(#"Renamed Columns","LTD","",Replacer.ReplaceText,{"Supplier (cleansed)"})
Can anyone help?
the solution is found here: please can you delete this entire post
= Text.Combine(List.RemoveMatchingItems(Text.Split([#"Supplier (cleansed)"]," "),{"ltd"},Comparer.OrdinalIgnoreCase)," ")
7 Replies
- Samarth_18Community Champion
Hi doubleclick ,
Please try below approach.
https://www.youtube.com/watch?v=-oM83cgs5uI
Thanks,
Samarth
- doubleclickResolver I
I watched this already - can someone help with the code?
- CNENFRNLCommunity Champion
= Table.ReplaceValue(#"Renamed Columns", null, null, (x,y,z) => Text.Replace(Text.Upper(x),"LTD",""), {"Supplier (cleansed)"})- doubleclickResolver I
this is only one variation?
i thought one of you da geniuses could do this easy
- doubleclickResolver I
can this post be deleted as no one seems to have an answer
- v-easonf-msftCommunity Support
Hi, doubleclick
List.ReplaceMatchitems is a function manipulate list values.
And you can place the comparer.orignalignorecase function as below:
= Table.AddColumn(#"Renamed Columns", "Custom", each Text.Combine(List.ReplaceMatchingItems({[#"Supplier (cleansed)"]},{{"ltd","Ltd"}},Comparer.OrdinalIgnoreCase)))Plesae check my attached pbix.
Best Regards,
Community Support Team _ Eason- doubleclickResolver I
the solution is found here: please can you delete this entire post
= Text.Combine(List.RemoveMatchingItems(Text.Split([#"Supplier (cleansed)"]," "),{"ltd"},Comparer.OrdinalIgnoreCase)," ")