Questions tagged [stringcollection]

Represents a collection of strings in C#

40 questions
0
votes
0 answers

Settings StringCollection: NullReferenceException

I would like to store some data from a list<.string> in a Settings.StringCollection (System.Collections.Specialized.StringCollection), but everytime I try to add the data to the collection, I get an Exception for this…
IanRawz
  • 19
  • 1
  • 5
0
votes
1 answer

Storing a string array in application settings

I have a string array of information that I need to pass from one user control to the other. The application settings contains a System.Collection.Specialized.StringCollection datatype for such cases. But since I need to use my array in a specific…
disasterkid
  • 6,948
  • 25
  • 94
  • 179
0
votes
1 answer

NullReference Exception was unhandled in foreach

An unhandled exception of type 'System.NullReferenceException' occurred in MyProject.exe Additional information: Object reference not set to an instance of an object. It says , StringCollection strCol is null, but table.Script() is not null (it…
0
votes
1 answer

VB.NET Trying to read a System.Collections.Specialized.StringCollection in My.Settings returns an InvalidOperationException

In my vb.net project i've created the following settings with the built-in settings manager from visual studio: appVisible (Boolean) saveFusedFiles (Boolean) colors (System.Collections.Specialized.StringCollection) separators…
0
votes
2 answers

Transform a string possibly including quotes into a StringCollection

I have a string like this: string subjectString = "one two \"three four\" five \"six seven\""; and I want to transform it into a StringCollection like this: one two three four five six seven Is there a way how to achieve this using a Regex class…
0
votes
1 answer

Combine line for line in two separate StringCollections

I am attempting to take two string collections and combine each line in both collections simultaneously to show a full file path for my user. Examples to help clear up confusion: String Collection 1 will contain a list of paths. Example:…
Jesse
  • 434
  • 2
  • 6
  • 16
0
votes
1 answer

WPF string collection binding, need to convert to an element type

I have a string collection that is bound to a MenuItem as it's ItemsSource (the strings are user added bookmarks representing folder paths). However, within the string collection I might have a string of, say, hyphens ("----") that I want to be…
Jake Shakesworth
  • 3,335
  • 4
  • 29
  • 43
0
votes
2 answers

String.ToCharArray() stored in StringCollection conversion to numbers and back in VB.net

I have a string which was converted to a char array and stored in a stringcollection, how do I return the numerical value for the character in each string? How can I reverse this process, getting the character from the numerical value? I know I…
Cyclone
  • 17,939
  • 45
  • 124
  • 193
-3
votes
1 answer

Can’t set StringCollection’ string

I have code PrinterSettings set = new PrinterSettings(); set.PrinterName = set.InstalledPrinters[0]; I can’t compile it because of error (Google translate): it is not possible to access this via an instance link. How to fix it?
Okumaima
  • 53
  • 1
  • 8
-4
votes
5 answers

How to remove unknown formatted strings from string array?

I'm trying to remove strings with unrecognized characters from string collection. What is the best way to accomplish this?
Rade Milovic
  • 965
  • 4
  • 13
  • 29
1 2
3