Click here to Skip to main content
15,900,378 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to disable a ListViewItem? Pin
Dave Kreskowiak27-Nov-07 9:03
mveDave Kreskowiak27-Nov-07 9:03 
Questionhow can i checked dynamicallay in gridview in windows. Pin
Rajeshwar Code- Developer26-Nov-07 19:55
Rajeshwar Code- Developer26-Nov-07 19:55 
AnswerRe: how can i checked dynamicallay in gridview in windows. Pin
Sun Rays26-Nov-07 19:57
Sun Rays26-Nov-07 19:57 
GeneralRe: how can i checked dynamicallay in gridview in windows. [modified] Pin
Rajeshwar Code- Developer26-Nov-07 20:07
Rajeshwar Code- Developer26-Nov-07 20:07 
GeneralRe: how can i checked dynamicallay in gridview in windows. Pin
Sun Rays26-Nov-07 20:57
Sun Rays26-Nov-07 20:57 
Questionhow to recognize deleted contact in outlook Pin
M LN Rao26-Nov-07 19:43
M LN Rao26-Nov-07 19:43 
AnswerRe: how to recognize deleted contact in outlook Pin
Sun Rays26-Nov-07 19:55
Sun Rays26-Nov-07 19:55 
GeneralRe: how to recognize deleted contact in outlook Pin
M LN Rao26-Nov-07 21:45
M LN Rao26-Nov-07 21:45 
QuestionDeleting data from text file using C#.NET Pin
D i x y26-Nov-07 19:26
D i x y26-Nov-07 19:26 
GeneralRe: Deleting data from text file using C#.NET Pin
Paul Conrad8-Dec-07 5:35
professionalPaul Conrad8-Dec-07 5:35 
Questionabout accounting transaction Pin
keyto26-Nov-07 19:22
keyto26-Nov-07 19:22 
AnswerRe: about accounting transaction Pin
Pankaj - Joshi26-Nov-07 19:27
Pankaj - Joshi26-Nov-07 19:27 
AnswerAccounting Fundamental Link Pin
KennyPatel26-Nov-07 21:28
KennyPatel26-Nov-07 21:28 
QuestionNetwork path Access problem Pin
Nishad8526-Nov-07 19:20
Nishad8526-Nov-07 19:20 
AnswerRe: Network path Access problem Pin
Pankaj - Joshi26-Nov-07 19:26
Pankaj - Joshi26-Nov-07 19:26 
AnswerRe: Network path Access problem Pin
KennyPatel26-Nov-07 21:25
KennyPatel26-Nov-07 21:25 
QuestionHow to stop scrolling of form when we scroll any control that has scrollbars? Pin
CodeVarma26-Nov-07 19:02
CodeVarma26-Nov-07 19:02 
AnswerRe: How to stop scrolling of form when we scroll any control that has scrollbars? Pin
Sun Rays26-Nov-07 20:05
Sun Rays26-Nov-07 20:05 
QuestionHow to replace very first character only......? Pin
Pankaj - Joshi26-Nov-07 19:01
Pankaj - Joshi26-Nov-07 19:01 
AnswerRe: How to replace very first character only......? Pin
stancrm26-Nov-07 19:59
stancrm26-Nov-07 19:59 
AnswerRe: How to replace very first character only......? Pin
Andrei Ungureanu26-Nov-07 20:04
Andrei Ungureanu26-Nov-07 20:04 
GeneralRe: How to replace very first character only......? Pin
Pankaj - Joshi26-Nov-07 21:34
Pankaj - Joshi26-Nov-07 21:34 
Thanks for your reply.

But it will give error in case of

string str = "";

Because this input is depend upon the end user So I can-not say the input data in Correct format.

Or if dash is not found then it will also give the error.


I make new code please let me know this is Ok or not...?
**************************************************************
public static string getNewItemName(string actualItemName, string saparaterCharacter)
{
string valueToReturn = "";
try
{
int ipos = actualItemName.ToString().IndexOf(saparaterCharacter.ToString());
if (ipos > -1) //That means saparator is not found...
{
if (saparaterCharacter.ToString().Length == 0)
valueToReturn = actualItemName.ToString();
else
{
string strFirstPart = actualItemName.ToString().Substring(0, ipos).ToString();
string strSecondPart = "";
if (actualItemName.ToString().Length == 0)
strSecondPart = actualItemName.ToString().Substring(ipos).ToString();
else
strSecondPart = actualItemName.ToString().Substring(ipos + 1).ToString();

valueToReturn = strFirstPart + ":" + strSecondPart;
}
}
else
valueToReturn = actualItemName.ToString();
}
catch (Exception)
{
//In Case of any error we are returning the same name
valueToReturn = actualItemName.ToString();
}
return valueToReturn;
}
**************************************************************


Regards
Pankaj Joshi

If you want to shape your dreams into reality, please wake-up...

AnswerRe: How to replace very first character only......? Pin
Sun Rays26-Nov-07 20:11
Sun Rays26-Nov-07 20:11 
GeneralRe: How to replace very first character only......? Pin
Pankaj - Joshi26-Nov-07 21:35
Pankaj - Joshi26-Nov-07 21:35 
GeneralRe: How to replace very first character only......? Pin
Sun Rays26-Nov-07 22:07
Sun Rays26-Nov-07 22:07 

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.