# 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;
    }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sneakyevil.gitbook.io/il2cpp-resolver/gameobject/find-with-substring.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
