GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::experimental::filesystem::path::stem(3) C++ Standard Libary std::experimental::filesystem::path::stem(3)

std::experimental::filesystem::path::stem - std::experimental::filesystem::path::stem


path stem() const; (filesystem TS)


Returns the filename identified by the path stripped of its extension.


Returns the substring from the beginning of filename() up to and not including the
last period (.) character.


If the filename is one of the special filesystem components dot or dot-dot, or if it
has no periods, the function returns the entire filename().


(none)


The stem of the filename identified by the path.


May throw implementation-defined exceptions.

// Run this code


#include <iostream>
#include <experimental/filesystem>
namespace fs = std::experimental::filesystem;


int main()
{
std::cout << fs::path("/foo/bar.txt").stem() << '\n'
<< fs::path("/foo/.bar").stem() << '\n';


for (fs::path p = "foo.bar.baz.tar"; !p.extension().empty(); p = p.stem())
std::cout << p.extension() << '\n';
}


"bar"
""
".tar"
".baz"
".bar"


filename returns the filename path component
(public member function)
extension returns the file extension path component
(public member function)

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.