[#BloombergLP-ball-CategoryManager_RadixTree-findLongestCommonPrefix-03] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/ball.adoc[ball]::xref:BloombergLP/ball/CategoryManager_RadixTree.adoc[CategoryManager_RadixTree]::findLongestCommonPrefix :relfileprefix: ../../../ :mrdocs: Return the longest matching key prefix with an associated value. == Synopsis Declared in `<ball_categorymanager_radixtree.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- std::string_view findLongestCommonPrefix( xref:BloombergLP/ball/CategoryManager_RadixTree/OptValueRef.adoc[OptValueRef]* value, std::string_view const& key); ---- == Description Return the longest prefix of the specified `key` that has an associated value in this tree, or an empty string view if no such prefix exists. If the optionally specified `value` is not null, load into `*value` a reference to the value associated with the returned prefix. Note that an empty return value can mean either that no matching prefix exists, or that the empty string itself is the longest matching prefix (when the tree contains a value for the empty key). Also note that the returned reference (if set) remains valid until the tree is modified. [.small]#Created with https://www.mrdocs.com[MrDocs]#