IT. Expert System.

C++

find_last_of()


Searches the string from the end that matches any of the characters specified in its arguments.

Syntax:
 find_last_of( const basic_string &str, size_type index = npos );
 find_last_of( const char *str, size_type index = npos );
 find_last_of( const char *str, size_type index, size_type num );
find_last_of( char ch, size_type index = npos );


Example:

#include        // std::cout
#include          // std::string

void SplitFilename (const std::string& str)
{
  std::cout << "splitting: " << str << '\n';
  unsigned found = str.find_last_of("/\\");
  std::cout << " path: " << str.substr(0,found) << '\n';
  std::cout << " file: " << str.substr(found+1) << '\n';
}

int main ()
{
  std::string str1 ("/usr/bin/man");
  std::string str2 ("c:\\windows\\winhelp.exe");

  splitfilename (str1);
  splitfilename (str2);

  return 0;
}
 


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 422 / 159132270. Delta: 0.00136 с