Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the string.find () function in C++

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article will explain in detail how to use the string.find () function in C++. The content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have some understanding of the relevant knowledge after reading this article.

# include # include using namespace std; void main () {copy code is as follows: / the find function returns the type size_typestring s ("1a2b3c4d5e6f7g8h9i1a2b3c4d5e6f7g8ha9i"); the string flag;string::size_type position;//find function returns the subscript position of jk in s position = s.find ("jk"); if (position! = s.npos) / / if it is not found, it returns a special flag indicated by npos in C++. Here the npos value is 4294967295, {cout.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report