String类的转换功能:
package com.itheima_05;
/*
* String类的转换功能:
* char[] toCharArray():把字符串转换为字符数组
* String toLowerCase():把字符串转换为小写字符串
* String toUpperCase():把字符串转换为大写字符串
*
* 字符串的遍历:
* A:length()加上charAt()
* B:把字符串转换为字符数组,然后遍历数组
*/
public class StringDemo {
public static void main(String[] args) {
//创建字符串对象
String s = "abcde"; //char[] toCharArray():把字符串转换为字符数组
char[] chs = s.toCharArray();
for(int x=0; x<chs.length; x++) {
System.out.println(chs[x]);
}
System.out.println("-----------"); //String toLowerCase():把字符串转换为小写字符串
System.out.println("HelloWorld".toLowerCase());
//String toUpperCase():把字符串转换为大写字符串
System.out.println("HelloWorld".toUpperCase());
}
}

数组里面的长度是属性。String类里面的长度是方法。

Transformation functionality for the String class的更多相关文章

  1. HDU 5842 Lweb and String(Lweb与字符串)

    p.MsoNormal { margin: 0pt; margin-bottom: .0001pt; text-align: justify; font-family: Calibri; font-s ...

  2. HDU 5842 Lweb and String

    Lweb and String Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)T ...

  3. HDU 5842 Lweb and String (水题)

    Lweb and String 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5842 Description Lweb has a string S ...

  4. CCPC网络赛,HDU_5842 Lweb and String

    Problem Description Lweb has a string $S$. Oneday, he decided to transform this string to a new sequ ...

  5. 2016中国大学生程序设计竞赛 - 网络选拔赛 1011 Lweb and String

    Problem Description Lweb has a string S. Oneday, he decided to transform this string to a new sequen ...

  6. HDU 5842 Lweb and String 水题

    Lweb and String 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5842 Description Lweb has a string S ...

  7. Lweb and String 超级大水题

    Lweb and String Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)T ...

  8. [Java 安全]加密算法

    Base64编码 算法简述 定义 Base64内容传送编码是一种以任意8位字节序列组合的描述形式,这种形式不易被人直接识别. Base64是一种很常见的编码规范,其作用是将二进制序列转换为人类可读的A ...

  9. Autofac

    程序集准备 Assembly: Autofac/Autofac.Integration.Mvc/System.Web.Mvc/System.Web.Helpers/System.Web.WebPage ...

随机推荐

  1. [转]ASP.NET MVC 4 最佳实践宝典

    原文:http://www.cnblogs.com/sonykings/archive/2013/05/30/3107531.html ASP.NET MVC最佳实践 本文档提供了一套旨在帮助创建最佳 ...

  2. 【数组】Maximum Product Subarray

    题目: Find the contiguous subarray within an array (containing at least one number) which has the larg ...

  3. C#中null值属于什么变量类型

    今天学习发现有段代码的输出结果有些理解不了,如图1,输出的结果全部为 false: 图1 后来和同事讨论研究了一下才明白,原来是这样:↓ class Program { static void Mai ...

  4. tcpdump非常实用的抓包实例

    详细的文档见tcpdump高级过滤技巧 基本语法 ========过滤主机--------- 抓取所有经过 eth1,目的或源地址是 192.168.1.1 的网络数据# tcpdump -i eth ...

  5. 自定义针对Product Key处理的TextBox

    代码: using System; using System.Collections.Generic; using System.Linq; using System.Text; using Syst ...

  6. WPF在XAML的资源中定义空字符串String.Empty

    代码如下: <!--1. 首先引用System的命名空间--> <Window x:Class="DriverEasyWPF.Views.DialogWindow" ...

  7. java面试②基础部分

    2.1.3 讲一下java中int数据占几个字节 java中有几种基本数据类型? 2.1.4. 面向对象的特征有哪些方面 有四大基本特征:封装.抽象.继承.多态 1)封装,即将对象封装成一个高度自治和 ...

  8. php的ajax简单实例

    很早就听闻ajax的名声,但是却一直不知道怎么用,今天自己捣鼓了一下,竟然会用了,哈哈哈哈. 为了防止我自己忘记,现在把这个简单的实例记录下.这个实例是网上搜的,文末附上链接. 首先你得有自己的服务器 ...

  9. C# 获取config文件 实体转换

    随着项目的扩展,单独的key,value配置文件已经不能满足需求了 这里需要自定义配置节点,例如 <!--自定义 具体实体类配置问节点信息--> <School Name=" ...

  10. [转]ASP.NET Core 指定环境发布(hosting environment)

    本文转自:https://www.cnblogs.com/xishuai/p/asp-net-core-set-hosting-environment-with-publish.html ASP.NE ...