窗体设计: 代码: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace WindowsFormsAppl
package main import ( "fmt" ) func main() { str := "hellOWorlD" //返回str is all lower char b := make([]byte, len(str)) for i, _:= range str{ s := str[i] if 'A' <= s && s <= 'Z' { s = s - 'A' + 'a' } b[i] = s } fmt.Println(
//将edit1中的每个字符串改为首字母大写 procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);begin with Sender as Tedit do if (text = '') or (text[selstart] = ' ') or ( sellength = length( text ) )then if Key in ['a'..'z'] then Key := Upcase(Key)
在java中有三个类负责对字符的操作:Character.String.StringBuffer.其中,Character类是对单个字符进行操作,String是对一个字符序列的操作,StringBuffer是对一串字符进行操作. 1. Character的声明 pubic final class Character extends Object implements Serializable,Comparable<Character> 2 . Char