1/*
2 * Copyright (c) 2023 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16/*
17 * @tc.name:fromCharCode
18 * @tc.desc:test String.fromCharCode and charat
19 * @tc.type: FUNC
20 * @tc.require: issueI5NO8G
21 */
22
23var str = String.fromCharCode(0);
24var str1 = String.fromCharCode(56);
25var str2 = String.fromCharCode(90);
26var str3 = String.fromCharCode(113);
27print(str1);
28print(str2);
29print(str3);
30var obj = {};
31obj[str1] = 'jjj1';
32obj[str2] = 'jjj2';
33obj[str3] = 'jjj3';
34print(obj[8]);
35print(obj.Z);
36print(obj.q);
37
38var str4 = "wode每一天";
39var str5 = "wodekk";
40print(str4.charAt(4));
41print(str5.charAt(4));
42obj[str5.charAt(4)] = 'jjj4';
43print(obj.k);
44
45
46var str6 = "wojjj*432$@#$";
47var str7 = "Π我的gljds&(%怕jfd"
48print(str6.codePointAt(3));
49print(str6.codePointAt(9));
50print(str6.codePointAt(12));
51print(str6.codePointAt(28));
52print(str7.codePointAt(0));
53print(str6.codePointAt(1));
54print(str6.codePointAt(12));
55print(str6.codePointAt(284));
56
57var str8 = "meiyou";
58var str9 = "haodeha";
59var str10 = "wodeyisishi";
60print(str8.concat(str9));
61print(str8.concat(str9, str10));
62print(str8.concat(str9, '  hh ', str10));
63
64var str11 = "djfaDJKLAD";
65var str12 = "djfaDJKLADf大家发";
66var str13 = "DJKLAD";
67
68print(str11.toLowerCase());
69print(str12.toLowerCase());
70print(str13.toLowerCase());