mirror of
				https://github.com/Kareadita/Kavita.git
				synced 2025-11-04 03:27:05 -05:00 
			
		
		
		
	
		
			
				
	
	
		
			16 lines
		
	
	
		
			443 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			443 B
		
	
	
	
		
			C#
		
	
	
	
	
	
using System.IO;
 | 
						|
 | 
						|
namespace API.Extensions;
 | 
						|
#nullable enable
 | 
						|
 | 
						|
public static class PathExtensions
 | 
						|
{
 | 
						|
    public static string GetFullPathWithoutExtension(this string filepath)
 | 
						|
    {
 | 
						|
        if (string.IsNullOrEmpty(filepath)) return filepath;
 | 
						|
        var extension = Path.GetExtension(filepath);
 | 
						|
        if (string.IsNullOrEmpty(extension)) return filepath;
 | 
						|
        return Path.GetFullPath(filepath.Replace(extension, string.Empty));
 | 
						|
    }
 | 
						|
}
 |