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


C++ nsString::Left方法代码示例

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


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

示例1: ExtractType

void nsEudoraCompose::ExtractType( nsString& str)
{
  nsString tStr;
  PRInt32 idx = str.FindChar( ';');
  if (idx != -1) {
    str.Left( tStr, idx);
    str = tStr;
  }
  str.Trim( kWhitespace);

  if ((str.CharAt( 0) == '"') && (str.Length() > 2)) {
    str.Mid( tStr, 1, str.Length() - 2);
    str = tStr;
    str.Trim( kWhitespace);
  }

  // if multipart then ignore it since no outlook message body is ever
  // valid multipart!
  if (str.Length() > 10) {
    str.Left( tStr, 10);
    if (tStr.LowerCaseEqualsLiteral("multipart/"))
      str.Truncate();
  }
}
开发者ID:binoc-software,项目名称:mozilla-cvs,代码行数:24,代码来源:nsEudoraCompose.cpp

示例2: SplitString

void nsOutlookMail::SplitString( nsString& val1, nsString& val2)
{
    nsString  temp;

    // Find the last line if there is more than one!
    PRInt32 idx = val1.RFind( "\x0D\x0A");
    PRInt32  cnt = 2;
    if (idx == -1) {
        cnt = 1;
        idx = val1.RFindChar( 13);
    }
    if (idx == -1)
        idx= val1.RFindChar( 10);
    if (idx != -1) {
        val1.Right( val2, val1.Length() - idx - cnt);
        val1.Left( temp, idx);
        val1 = temp;
        SanitizeValue( val1);
    }
}
开发者ID:mikeconley,项目名称:comm-central,代码行数:20,代码来源:nsOutlookMail.cpp


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