Skip to content

Instantly share code, notes, and snippets.

@PrashantUnity
Created December 21, 2022 09:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PrashantUnity/9b89a50d2a3f076d1784cd3dfcd7df27 to your computer and use it in GitHub Desktop.
Save PrashantUnity/9b89a50d2a3f076d1784cd3dfcd7df27 to your computer and use it in GitHub Desktop.
public List<List<int>> ListFromString(string str)
{
return str.Split(']')
.Where(x => x.Length > 0)
.Select(x=> x
.Split(new char[] { '[', ',' })
.Where(m => m.Length > 0)
.Select(m => Convert.ToInt32(m))
.ToList())
.ToList();
}
@PrashantUnity
Copy link
Author

Making public

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment