How to locate elements with accessibility ID having a new line

I need to locate an element which has an accessibility ID with a newline inside. How can I do that? Is there a CONTAINS method for accessibility IDs?

I guess the only way to work around this is (WebdriverIO syntax):

  • on Android by using
const selector = 'new UiSelector().descriptionContains("String");        
        return $(`android=${selector}`);
  • on iOS with
const selector = 'label BEGINSWITH "String"' ;
        return $(`-ios predicate string:${selector}`)