This shows you the differences between two versions of the page.
| Previous revision | |||
| — | fuss:libopenmetaverse [2025/10/21 23:26] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Extract Full Avatar Name ====== | ||
| + | libopenmetaverse uses different possible avatar name formats when passing avatar names. For example, an avatar name can be in one of the following formats: | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | |||
| + | The following brief LINQ query will help you resolve all these names to a list of two elements: | ||
| + | <code csharp> | ||
| + | string avatarName = " | ||
| + | // ... | ||
| + | List< | ||
| + | new List< | ||
| + | .Cast< | ||
| + | .ToDictionary(o => new[] | ||
| + | { | ||
| + | o.Groups[" | ||
| + | o.Groups[" | ||
| + | }).SelectMany(o => new[] {o.Key[0], !string.IsNullOrEmpty(o.Key[1]) ? o.Key[1] : " | ||
| + | Console.WriteLine(name.First()); | ||
| + | Console.WriteLine(name.Last()); | ||
| + | Console.ReadKey(); | ||
| + | </ | ||
| + | |||
| + | where the list '' | ||
For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.