|
-
January 12th, 2011, 06:55 AM
#1
begginer help
hi i want to remove a file extension from a string how can i do this ?
DirectoryInfo di = new DirectoryInfo(@"threads/");
FileInfo[] threads = di.GetFiles("*.aspx");
foreach (FileInfo file in threads)
{
string x = file.Name;
char[] y = x.ToCharArray();
int i = x.Length;
char[] j;
int t = 0;
while (t < (i - 4))
{
j[t] = y[t];
t++;
}
Literal1.Text = "<a href=" + x +">" + x + "</a>";
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|