⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mystring.cpp

📁 WinCE5.0部分核心源码
💻 CPP
字号:
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// This source code is licensed under Microsoft Shared Source License
// Version 1.0 for Windows CE.
// For a copy of the license visit http://go.microsoft.com/fwlink/?LinkId=3223.
//
#include "mystring.h"
#include <iostream>
#include <algorithm>

using namespace std;

bool operator==(const string &o1, const string &o2){
  string s1 = o1;
  string s2 = o2;

  s1 = lowercase(s1);
  s2 = lowercase(s2);

  return s1.compare(s2) == 0;
}

bool operator==(const string &o1, const char *o2){
  string s1 = o1;
  string s2 = o2;
  
  s1 = lowercase(s1);
  s2 = lowercase(s2);

  return s1.compare(s2) == 0;
}

bool operator==(const char *o1, const string &o2){
  string s1 = o1;
  string s2 = o2;
  
  s1 = lowercase(s1);
  s2 = lowercase(s2);

  return s1.compare(s2) == 0;
}

bool operator!=(const string &o1, const string &o2){
  return !(o1 == o2);
}

bool operator!=(const string &o1, const char *o2){
  return !(o1 == o2);
}

bool operator!=(const char *o1, const string &o2){
  return !(o1 == o2);
}

string lowercase(string s){
  for(unsigned int i = 0; i < s.length(); i++)
    s[i] = tolower(s[i]);

  return s;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -