> For the complete documentation index, see [llms.txt](https://sneakyevil.gitbook.io/il2cpp-resolver/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sneakyevil.gitbook.io/il2cpp-resolver/gameobject/find-with-substring.md).

# Find with substring

```cpp
std::string m_sObjectSubstring = "VRCPlayer[Local]";

// Obtain list
Unity::il2cppArray<Unity::CGameObject*>* m_pObjects = Unity::Object::FindObjectsOfType<Unity::CGameObject>(UNITY_GAMEOBJECT_CLASS);

// Looping through list
for (uintptr_t u = 0U; m_pObjects->m_uMaxLength > u; ++u)
{
    Unity::CGameObject* m_pObject = m_pObjects->m_pValues[u];
    if (!m_pObject) continue; // Just in-case

    // Obtaining object name and then converting it to std::string
    std::string m_sObjectName = m_pObject->GetName()->ToString();
    if (m_sObjectName.find(m_sObjectSubstring) != std::string::npos)
    {
        // Your code after it finds desired object.
        break;
    }
}
```
