My brawl with C# string manipulation and updates on my work

I spent most of the day building an EEG signal simulator.  Instead of reading voltages from an amp, the engine reads pre-recorded data from a text file.  This will provide a playback of previous sessions and allow us to test our program without having to have an amp always available.  More days working at home maybe?

I ran into a bit of a snag while working with the StreamReader.  I pulled in the data using ReadLine() and placed it into a string.  I discovered quickly that each line had tabs in it.  (seen as \t)  I tried replacing the tags using string.Replace(), string.Trim(), and some remove char method using Regular Expressions.  None of these worked and when I looked for answers on the Internet, everyone assumed I was not placing the results of the manipulation into a new string.  Apparently that’s a common mistake.  After blood, sweat, and tears, I created a new string and placed the original ReadLine() string into that one. That solved the problem.  I’m not sure why because the original string was still a string, but it worked and I’m content.  Perhaps the original string is still tied to the ReadLine() function and therefore cannot be manipulated.  So, fellow coders, if you are to stumble into that problem and everything appears to be working, make sure anything coming from a StreamReader function is placed into an independent string before manipulation.

I’ve also started playing with Flickr.  I may be working with it extensively in my internship, so I’m learning the gist of it before I make my recommendations.  So far, I like it.  I’ve made a private and public set of stock photos.  It will come in handy when I have designers working with me and they need to access my stock photos.  I’ve also linked the public set to my wordpress page so check it out while you’re here!

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s