xquerymicrostrategy

XQuery Replace 'ü' to 'u' for Turkish characters


i've function for dynamic parameter. Im using MicroStrategy tool for this.

let $uri := replace('http://url/suggest?searchTerm=DYNAMIC PROMPT','\s+','%20')

i want to replace 'ü' to 'u' for in this function. I already use ('\s+','%20') for space character.


Solution

  • Multiple replace functions can be nested:

    let $string := 'http://url/suggest?searchTerm=DüNAMIC PROMPT'
    let $uri := replace(replace($string, '\s+','%20'), 'ü', 'u')
    return $uri
    

    For replacing single characters, you can also use the translate function:

    let $string := 'http://url/suggest?searchTerm=DüNAMIC PROMPT'
    let $uri := translate($string, ' üÜöÖäÄ','+uUoOaA')
    return $uri