I want to match the case of a string to that of an example string. For example.
var str = "hello world"
var example1 = "My Text Is Great"
var example2 = "my Text Is Great"
var example3 = "My text is great"
answer1 = someGreatFunction(str,example1)//should return Hello World
answer2 = someGreatFunction(str,example2)//should return hello World
answer3 = someGreatFunction(str,example3)//should return Hello world
I hope this helps you understand what I want. I don't want to worry about quotation marks or any form of punctuation. But if it includes a support for that it will be great.
P.S. I haven't tried doing anything till now because I am clueless.
P.S. If you think this question is duplicate please don't mark it so. Maybe I had already looked through the solutions but didn't found anything satisfying.