Click here to Skip to main content
15,868,349 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi..
I am trying to getting full path with some format.
I am getting an error:System.FormatException "String must be exactly one character long.".
I am posting my code.
May i know where i am going wrong.And what does this actually mean.
C#
SelectedPath = FullPath.Replace(Path.DirectorySeparatorChar, '/');

SelectedPath = string.Concat("/", SelectedPath.TrimStart('/'));
Posted
Comments
Manas Bhardwaj 22-Sep-14 6:26am    
What is the data type you are using for SelectedPath? It should be string!
Member 10955785 23-Sep-14 0:18am    
yes, it is string.
Richard MacCutchan 22-Sep-14 7:25am    
Which of the above two lines gives the error?
Member 10955785 23-Sep-14 0:18am    
i got this error
System.FormatException_"String must be exactly one character long."
Richard MacCutchan 23-Sep-14 4:02am    
You already told us that. But you have still not shown which line gives the error.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900