Brad Boyce
Brad Boyce

Reputation: 1258

How to get file name without extension in Silverlight with C#?

I found this answer for C#

C# getting file names without extensions

which uses Path.GetFileNameWithoutExtension(fi.Name), but it doesn't work for Silverlight. Intellisense doesn't recognize it.

Upvotes: 0

Views: 1148

Answers (1)

Evan Mulawski
Evan Mulawski

Reputation: 55354

According to the documentation, Path.GetFileNameWithoutExtension() is supported in Silverlight 3 and 4. Make sure you have imported System.IO or used:

... = System.IO.Path.GetFileNameWithoutExtension(fi.Name);

Upvotes: 3

Related Questions