Click here to Skip to main content
15,915,763 members
Home / Discussions / C#
   

C#

 
QuestionRead only strings Pin
TheMajorRager12-Oct-05 7:52
TheMajorRager12-Oct-05 7:52 
Hello again everyone. I am writing this function that checks when a string has a blank in it, and if it does, I want to replace it with an underscore, but when I compile my program I get this error:

Property or indexer 'string.this[int]' cannot be assigned to -- it is read only.

Here is my function, it is very simple:
<br />
public void File_Fix_Spaces(string original_file, string text)<br />
		{<br />
			bool done = false;<br />
		<br />
			string new_filename = "";<br />
		<br />
			for(int i=0; i<original_file.Length; i++)<br />
			{<br />
				if(original_file[i]==' ')<br />
				{<br />
					original_file[i] = '_';<br />
					done = true;<br />
				}<br />
			}<br />
}<br />

AnswerRe: Read only strings Pin
Dave Kreskowiak12-Oct-05 8:05
mveDave Kreskowiak12-Oct-05 8:05 
AnswerRe: Read only strings Pin
Robert Rohde12-Oct-05 8:50
Robert Rohde12-Oct-05 8:50 
GeneralRe: Read only strings Pin
Dave Kreskowiak12-Oct-05 11:38
mveDave Kreskowiak12-Oct-05 11:38 
QuestionPlease could someone help me with the code required to access resources in a res file Pin
Rendili12-Oct-05 7:49
Rendili12-Oct-05 7:49 
QuestionAssign null value to a Decimal Pin
zaboboa12-Oct-05 7:41
zaboboa12-Oct-05 7:41 
AnswerRe: Assign null value to a Decimal Pin
Dan Neely12-Oct-05 7:49
Dan Neely12-Oct-05 7:49 
GeneralRe: Assign null value to a Decimal Pin
zaboboa12-Oct-05 7:50
zaboboa12-Oct-05 7:50 
AnswerRe: Assign null value to a Decimal Pin
David Stone12-Oct-05 7:50
sitebuilderDavid Stone12-Oct-05 7:50 
AnswerRe: Assign null value to a Decimal Pin
Dave Kreskowiak12-Oct-05 8:02
mveDave Kreskowiak12-Oct-05 8:02 
QuestionURGENT please - play a .avi file by a file stream Pin
Sasuko12-Oct-05 6:37
Sasuko12-Oct-05 6:37 
AnswerRe: URGENT please - play a .avi file by a file stream Pin
David Stone12-Oct-05 6:44
sitebuilderDavid Stone12-Oct-05 6:44 
GeneralRe: URGENT please - play a .avi file by a file stream Pin
Sasuko12-Oct-05 7:10
Sasuko12-Oct-05 7:10 
GeneralRe: URGENT please - play a .avi file by a file stream Pin
David Stone12-Oct-05 7:20
sitebuilderDavid Stone12-Oct-05 7:20 
GeneralRe: URGENT please - play a .avi file by a file stream Pin
Sasuko12-Oct-05 7:31
Sasuko12-Oct-05 7:31 
GeneralRe: URGENT please - play a .avi file by a file stream Pin
David Stone12-Oct-05 7:48
sitebuilderDavid Stone12-Oct-05 7:48 
GeneralRe: URGENT please - play a .avi file by a file stream Pin
Dave Kreskowiak12-Oct-05 7:59
mveDave Kreskowiak12-Oct-05 7:59 
GeneralRe: URGENT please - play a .avi file by a file stream Pin
Sasuko12-Oct-05 8:19
Sasuko12-Oct-05 8:19 
GeneralRe: URGENT please - play a .avi file by a file stream Pin
Dave Kreskowiak12-Oct-05 11:55
mveDave Kreskowiak12-Oct-05 11:55 
GeneralRe: URGENT please - play a .avi file by a file stream Pin
Sasuko12-Oct-05 11:59
Sasuko12-Oct-05 11:59 
QuestionTCP Synchronous Encryption in C# .NET Pin
IHSSITEMAN12-Oct-05 6:04
IHSSITEMAN12-Oct-05 6:04 
AnswerRe: TCP Synchronous Encryption in C# .NET Pin
David Stone12-Oct-05 6:49
sitebuilderDavid Stone12-Oct-05 6:49 
GeneralRe: TCP Synchronous Encryption in C# .NET Pin
IHSSITEMAN12-Oct-05 7:51
IHSSITEMAN12-Oct-05 7:51 
QuestionRunning Word Macros from an external file using Automation Pin
Guinness4Strength12-Oct-05 5:23
Guinness4Strength12-Oct-05 5:23 
QuestionAdd a List to a Console Application Pin
kmg4312-Oct-05 5:01
kmg4312-Oct-05 5:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.