9 EYLÜL 2008, Salı
Nasıl C string dosya uzantısı
Bir dize "dosya adı."ne için uzatma parçası olun. conf
Çapraz platform bir çözüm istiyorum.
CEVAP
9 EYLÜL 2008, Salı
Bu çözüm çok basit.
#include <iostream>
#include<string>
int main()
{
std::string fn = "filename.conf";
if(fn.substr(fn.find_last_of(".") 1) == "conf") {
std::cout << "Yes..." << std::endl;
} else {
std::cout << "No..." << std::endl;
}
}
Bunu Paylaş:
Dosya kullanır .md uzantısı ve bunları...
Nasıl PHP bir dosya uzantısı ayıklamak...
Nasıl okunur bir metin Python string b...
Python nasıl bir yol uzantısı olmadan ...
Kullanarak .NET, nasıl bir dosya imza ...