How to remove extra spaces using whitespace? [Resolved]

Posted by Gudevg under C# on 4/7/2012 | Points: 10 | Views : 1498 | Status : [Member] | Replies : 9
I used the below mention code to remove extra spaces occur in a document it ran successfully but extra spaces are not rearranged properly.

public static string ConvertWhitespacesToSingleSpaces(string strValue)
{
strValue = Regex.Replace(value, @"\s+", " ");
return strValue;
}

Any one please look into this to solve?


Regards,

Deepakkumar G.


Responses

Posted by: Sakthi.Singaravel on: 4/7/2012 [Member] Silver | Points: 50

Up
0
Down

Resolved
public static string ConvertWhitespacesToSingleSpaces(string strValue)
{
strValue = Regex.Replace(value , @"\s+", " ");
return strValue;
}

Above code value represents input value..?

Regards,
Singaravel M

Gudevg, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gudevg on: 4/7/2012 [Member] Starter | Points: 25

Up
0
Down
Oops i did not notice that vel ji, Sorry

Deepakkumar G.

Gudevg, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 4/7/2012 [Member] Silver | Points: 25

Up
0
Down
its okay..

Go Ahead..

All the Best..

Regards,
Singaravel M

Gudevg, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hariinakoti on: 4/9/2012 [Member] Starter | Points: 25

Up
0
Down
U r right Sakthi....

Thanks & Regards
Hari

Gudevg, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 4/9/2012 [Member] Silver | Points: 25

Up
0
Down
Thank u Hari

Regards,
Singaravel M

Gudevg, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 4/9/2012 [Member] Silver | Points: 25

Up
0
Down
hi gudevg,
if got frm my guidence means, plz "mark as answer" for me..

Regards,
Singaravel M

Gudevg, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gudevg on: 4/9/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,

I was marked as answer for your response only.


Regards

Deepakkumar G.

Gudevg, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 4/9/2012 [Member] Silver | Points: 25

Up
0
Down
thank you deepakkumar

Regards,
Singaravel M

Gudevg, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gudevg on: 4/9/2012 [Member] Starter | Points: 25

Up
0
Down
Mention not.



Regards,

Deepakkumar G.

Gudevg, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response