© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•13mo ago•
16 replies
-Epitaph-

Cannot implicitly convert int to string

foreach (var kv in json["lines"]) // there might be a faster way to do this? looks like this algo is On^ NO ITS NOT
          {
            Dictionary<string, int> lyricMap = new Dictionary<string, int>();
            string words = kv.words;
            int timeList = kv.startTimeMs;
            lyricMap.Add("words", timeList);
            {
              string wordMap = lyricMap["words"];
            }
          }
foreach (var kv in json["lines"]) // there might be a faster way to do this? looks like this algo is On^ NO ITS NOT
          {
            Dictionary<string, int> lyricMap = new Dictionary<string, int>();
            string words = kv.words;
            int timeList = kv.startTimeMs;
            lyricMap.Add("words", timeList);
            {
              string wordMap = lyricMap["words"];
            }
          }

I'm trying to assign a variable to the "words" in the hashmap but for some reason apparently its an integer?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Cannot implicitly convert type 'System.Threading.Tasks.Task<string>' to 'string'
C#CC# / help
3y ago