当前位置: 首页>>代码示例>>C++>>正文


C++ wstring::find_first_not_of方法代码示例

本文整理汇总了C++中wstring::find_first_not_of方法的典型用法代码示例。如果您正苦于以下问题:C++ wstring::find_first_not_of方法的具体用法?C++ wstring::find_first_not_of怎么用?C++ wstring::find_first_not_of使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wstring的用法示例。


在下文中一共展示了wstring::find_first_not_of方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SHTokenizeW

void SHTokenizeW( 
	const wstring& target, 
	vector<wstring>& tokens, 
	const wstring &delim 
	)
{
	wstring::size_type lastPos = target.find_first_not_of( delim );
	wstring::size_type pos = target.find_first_of( delim, lastPos );

	while( wstring::npos != pos || wstring::npos != lastPos )
	{
		tokens.push_back( target.substr(lastPos, pos - lastPos) );
		lastPos = target.find_first_not_of( delim, pos );
		pos = target.find_first_of( delim, lastPos );
	}
}
开发者ID:poorboy,项目名称:ProcessFileSystem,代码行数:16,代码来源:StringHelper.cpp

示例2: trim

/* static */
void ConfigFile::trim( wstring& s )
{
	// Remove leading and trailing whitespace
	static const wchar_t whitespace[] = L" \n\t\v\r\f";
	s.erase( 0, s.find_first_not_of(whitespace) );
	s.erase( s.find_last_not_of(whitespace) + 1U );
}
开发者ID:chinarustin,项目名称:aep,代码行数:8,代码来源:config_file.cpp

示例3: string_strip

static void string_strip(wstring& s)
{
    static const wchar_t* empties = L" \t\n\r";
    int e = s.find_last_not_of(empties);
    s.erase(e + 1);
    int b = s.find_first_not_of(empties);
    s.erase(0,b);
}
开发者ID:kitserver,项目名称:kitserver8,代码行数:8,代码来源:bserv.cpp

示例4: LTrim

void LTrim( wstring& wsInOut )
{
	size_t nPos = wsInOut.find_first_not_of(L" \n\r\t");
	if (nPos!= wstring::npos)
	{
		wsInOut = wsInOut.substr(nPos); 
	}
}
开发者ID:tianyx,项目名称:TxUIProject,代码行数:8,代码来源:StrConvert.cpp

示例5: Tokenize

size_t Tokenize(const wstring& str, const wstring& delimiters,
                vector<wstring>& tokens) {
  tokens.clear();

  size_t index_begin = str.find_first_not_of(delimiters);

  while (index_begin != wstring::npos) {
    size_t index_end = str.find_first_of(delimiters, index_begin + 1);
    if (index_end == wstring::npos) {
      tokens.push_back(str.substr(index_begin));
      break;
    } else {
      tokens.push_back(str.substr(index_begin, index_end - index_begin));
      index_begin = str.find_first_not_of(delimiters, index_end + 1);
    }
  }

  return tokens.size();
}
开发者ID:vjcagay,项目名称:taiga,代码行数:19,代码来源:string.cpp

示例6: trim

void trim(wstring& str) {
    wstring::size_type pos = str.find_last_not_of(' ');
    if(pos != string::npos) {
        str.erase(pos + 1);
        pos = str.find_first_not_of(' ');
        if(pos != string::npos) 
            str.erase(0, pos);
    }
    else 
        str.erase(str.begin(), str.end());
}
开发者ID:funambol-mirror,项目名称:funambol-windows-client,代码行数:11,代码来源:ClientUtil.cpp

示例7: Trim

wstring StringUtility::Trim(const wstring& wstr)
{
    const wchar_t* WHITE_SPACES = L" \t";

    wstring result;
    wstring::size_type left = wstr.find_first_not_of(WHITE_SPACES);
    if (left != wstring::npos)
    {
        wstring::size_type right = wstr.find_last_not_of(WHITE_SPACES);
        result = wstr.substr(left, right - left + 1);
    }

    return FilterQuotations(result);
}
开发者ID:bzquan,项目名称:CucumberCpp,代码行数:14,代码来源:StringUtility.cpp

示例8: Trim

void Trim(wstring& str, const wchar_t trim_chars[],
          bool trim_left, bool trim_right) {
  if (str.empty())
    return;

  const size_t index_begin =
      trim_left ? str.find_first_not_of(trim_chars) : 0;
  const size_t index_end =
      trim_right ? str.find_last_not_of(trim_chars) : str.length() - 1;

  if (index_begin == wstring::npos || index_end == wstring::npos) {
    str.clear();
    return;
  }

  if (trim_right)
    str.erase(index_end + 1, str.length() - index_end + 1);
  if (trim_left)
    str.erase(0, index_begin);
}
开发者ID:vjcagay,项目名称:taiga,代码行数:20,代码来源:string.cpp

示例9: ReadOifLine

void OIFReader::ReadOifLine(wstring oneline)
{
   //process
   if (oneline.substr(0, 6) == L"[Axis ")
   {
      axis_num++;
   }
   else
   {
      if (axis_num > -1)
      {
         size_t pos = oneline.find(L'=');
         wstring str1 = oneline.substr(0, oneline.find_last_not_of(L' ', pos));
         wstring str2 = oneline.substr(oneline.find_first_not_of(L' ', pos+1));

         if (str1 == L"AxisCode")
         {
            if (cur_axis != axis_num)
            {
               cur_axis = axis_num;
               axis_code.clear();
               pix_unit.clear();
               max_size.clear();
               start_pos.clear();
               end_pos.clear();
            }
            axis_code = str2;
         }
         else if (str1 == L"PixUnit")
         {
            if (cur_axis != axis_num)
            {
               cur_axis = axis_num;
               axis_code.clear();
               pix_unit.clear();
               max_size.clear();
               start_pos.clear();
               end_pos.clear();
            }
            pix_unit = str2;
         }
         else if (str1 == L"MaxSize")
         {
            if (cur_axis != axis_num)
            {
               cur_axis = axis_num;
               axis_code.clear();
               pix_unit.clear();
               max_size.clear();
               start_pos.clear();
               end_pos.clear();
            }
            max_size = str2;
         }
         else if (str1 == L"StartPosition")
         {
            if (cur_axis != axis_num)
            {
               cur_axis = axis_num;
               axis_code.clear();
               pix_unit.clear();
               max_size.clear();
               start_pos.clear();
               end_pos.clear();
            }
            start_pos = str2;
         }
         else if (str1 == L"EndPosition")
         {
            if (cur_axis != axis_num)
            {
               cur_axis = axis_num;
               axis_code.clear();
               pix_unit.clear();
               max_size.clear();
               start_pos.clear();
               end_pos.clear();
            }
            end_pos = str2;
         }
      }
   }
   if (oneline.substr(0, 9) == L"[Channel ")
   {
	  light_type.clear();
      chan_num++;
   }
   else
   {
      if (chan_num > -1)
      {
         size_t pos = oneline.find(L'=');
         wstring str1 = oneline.substr(0, oneline.find_last_not_of(L' ', pos));
         wstring str2 = oneline.substr(oneline.find_first_not_of(L' ', pos+1));
		 wstring str3 = L"Transmitted Light";
		 if (str1 == L"LightType") {
			 light_type = str2;
			 if (light_type.find(str3) != wstring::npos) {
				 for (int i = m_excitation_wavelength_list.size() -1; i >=0; i--) {
					 if (m_excitation_wavelength_list.at(i).chan_num == cur_chan) {
//.........这里部分代码省略.........
开发者ID:basisunus,项目名称:fluorender_analysis,代码行数:101,代码来源:oif_reader.cpp

示例10: TrimLeftW

wstring TrimLeftW(const wstring& str)
{
	size_t n = str.find_first_not_of(L" \t\v");
	return (n == wstring::npos) ? str : str.substr(n, str.length());
}
开发者ID:poorboy,项目名称:ProcessFileSystem,代码行数:5,代码来源:StringHelper.cpp

示例11: TrimW

void TrimW(wstring& s)
{
	const wstring DropChar = L" ";
	s.erase(s.find_last_not_of(DropChar)+1);
	s.erase(0, s.find_first_not_of(DropChar));
}
开发者ID:xmoeproject,项目名称:X-moe,代码行数:6,代码来源:ToolChain.cpp


注:本文中的wstring::find_first_not_of方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。