Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to realize string comparison by integrating SpringBoot with MybatisPlus

Shulou Source: shulou.com Published: 2022-05-31 23:51:28 10月05日 Update

This article will explain in detail how SpringBoot integrates MybatisPlus to achieve string comparison. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

Problem description

Given two strings consisting only of uppercase or lowercase letters (length between 1 and 10), the relationship between them is one of the following 4 cases:

1: the length of the two strings is different. Like Beijing and Hebei.

2: not only are the two strings equal in length, but also the characters in the corresponding positions are exactly the same (case sensitive), such as Beijing and Beijing

3: the two strings are equal in length, and the characters in the corresponding position can be exactly the same only if they are not case-sensitive (that is, it does not satisfy case 2). Like beijing and BEIjing.

4: two strings are equal in length, but even case-insensitive cannot make the two strings consistent. Like Beijing and Nanjing.

Programming determines which of the four categories belongs to the relationship between the two input strings, and gives the number of the class to which it belongs.

Input format

Consists of two lines, each of which is a string

Output format

There is only one number indicating the relationship number of the two strings

Submission code # include # include using namespace std;int main () {string str1,str2;;getline (cin,str1); getline (cin,str2); / / length is between 1 and 10 if (str1.size ()! = str2.size ()) / / str1.legth () cout is also available

Tags: Character string two length between consistent size article output integration same position letter lowercase case more format input good practical Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Linux NVidia MariaDB Microsoft