At most, in a string quartet, I've seen 4 flats or sharps. Now I have been told that this is because C major, G major, D major and A major are the easiest keys on a string instrument because they have the most open strings and the next easiest would be F major, Bb major, and Eb major.
And of course the parallel minors of C, G, D, and A are relatively easy on a string instrument as well.
I have also been told that unlike on a piano which uses equal temperament, string instruments use just intonation which means that a violinist has no desire to play C# major for example but for a pianist it is just as desirable as any other key is. I don't know why the tuning system would make certain keys not desirable. But the open strings makes sense, less fingerings so it is easier to play in C major which has all the open strings than F minor which has just C and G as open strings. F# major is actually the only key with no open strings at all. But then why is C minor relatively easy? It has only 2 open strings also. I guess it has to do with the parallel key of C major being easy.
So, if I were to compose a string quartet which I plan to do at some point, no matter how much I like the key of C# major, I should probably avoid it at all costs and use C# major for a woodwind quartet or a piano piece instead, right and as a rule of thumb never go above 4 accidentals for a string quartet and instead try to reach the expressiveness of keys with more accidentals in other ways(such as a cello solo or lots of other ways).
But is it just the open strings as I speculate it is as to why I don't see string quartets composed in keys with more than 4 sharps or flats?