当前位置: 首页 > news >正文

平时发现同学做的ppt找的材料图片不错_不知道从哪些网站可以获得seo搜索引擎优化薪资水平

平时发现同学做的ppt找的材料图片不错_不知道从哪些网站可以获得,seo搜索引擎优化薪资水平,网络组建与维护论文,做淘宝链接模板网站显示转换: 通过一些方法可以将其他数据类型转换为我们想要的数据类型 1.括号强转 作用: 一般情况下 将高精度的类型转换为低精度 // 语法: 变量类型 变量名 (转换的变量类型名称) 变量; // 注意: 精度问题 范围问题 sbyte sb 1; short s 1; int …

显示转换: 通过一些方法可以将其他数据类型转换为我们想要的数据类型

1.括号强转

作用: 一般情况下 将高精度的类型转换为低精度
            // 语法: 变量类型 变量名 = (转换的变量类型名称) 变量;
            // 注意: 精度问题 范围问题

sbyte sb = 1;
short s = 1;
int i = 10;
long l = -1;

强转时 可能会出现范围问题 需要注意

 s = (short)i;sb = (sbyte)l;Console.WriteLine(s);Console.WriteLine(sb);

无符号

byte b = 5;
ushort us = 6;
uint ui = 10;
ulong ul = 10;b = (byte)ul;
Console.WriteLine(b);

不同类型 无符号和有符号强转
            // 注意 强转时一定要注意范围 不然得到的结果会异常

 b = (byte)l;Console.WriteLine(b);// 浮点数decimal dl = 0.6m;double d = 2.8;float f = 0.5f;// 浮点数之间强转 : 同整数之间相同dl = (decimal)d;Console.WriteLine(dl);// 整形和浮点数进行转换// 浮点数强转为整形时 会直接省略掉小数点后面的小数i = (int)dl;Console.WriteLine("这是强转decimal:" + i);i = (int)d;Console.WriteLine("这是强转double:" + i);i = (int)f;Console.WriteLine("这是强转float:" + i);

 字符类型 : 可以将数字强转为char类型(有这个ASCII码)

int A = 'a';
Console.WriteLine(A); 
char c = (char)A;
Console.WriteLine(c); 
// 布尔类型 : 无法进行强转
bool t = true;
// t = (float)t;
// Console.WriteLine(t);
// string 类型 : 无法进行强转
string str = "123";
// str = (int)str;
// 布尔类型和string类型 是无法进行强转的

2.Parse法

作用: 将字符串类型转换为对应的类型
            // 语法: 变量类型.parse(字符串);
            // 注意: 字符串必须能够转换为相应类型 否则报错

string str2 = "1254536";
i = int.Parse(str2);
Console.WriteLine(i);

我们转换字符串 必须是要能够转成对应类型的字符 否则会报错
            // 转换时 其实也遵循隐式转换原则 大范围装小范围
            // i = int.Parse("123.45");

 string str3 = "123.45";float f2 = float.Parse(str3);Console.WriteLine(f2);string str7 = "123";float f3 = float.Parse(str7);Console.WriteLine("直接使用float去转换整数字符串"+ f3);

string str4 = "15645666";
// byte b4 = byte.Parse(str4);
// Console.WriteLine(b4);
string str5 = "1";
// 有符号
long l5 = long.Parse(str5);
int i5 = int.Parse(str5);
short s5 = short.Parse(str5);
sbyte sb5 = sbyte.Parse(str5);
// 无符号
ulong ul5 = ulong.Parse(str5);
uint ui5 = uint.Parse(str5);
ushort us5 = ushort.Parse(str5);
byte b5 = byte.Parse(str5);
// 浮点数
string str6 = "123.5";
float f5 = float.Parse(str6);
double d5 = double.Parse(str6);
decimal dl5 = decimal.Parse(str6);

// 布尔值
bool bl5 = bool.Parse("true");
bool bl6 = bool.Parse("false");
Console.WriteLine(bl5);
Console.WriteLine(bl6);
// 字符
char c6 = char.Parse("A");
Console.WriteLine(c6);

3.Convert法 

作用: 更加准确的将各个类型之间进行相互转换
            // 用法: Convert.To目标类型(变量或常量)
            // 注意: 需要转换的变量或者常量必须正确 否则会报错

每一个类型都存在一个对应的convert.to方法
           

// 有符号
long lg = Convert.ToInt64(str_one);
int it = Convert.ToInt32(str_one);
short st = Convert.ToInt16(str_one);
sbyte sbt = Convert.ToSByte(str_one);// 无符号
ulong ulg = Convert.ToUInt64(str_one);
uint uit = Convert.ToUInt32(str_one);
ushort ust = Convert.ToUInt16(str_one);
byte bt = Convert.ToByte(str_one);
// 浮点数
float ft = Convert.ToSingle(str_one);
double db = Convert.ToDouble(str_one);
decimal dc = Convert.ToDecimal(str_one);
Console.WriteLine(lg);
Console.WriteLine(ft);
Console.WriteLine(db);
Console.WriteLine(dc);
Console.WriteLine("************************************");

convert 方法  精度更加准确
            // 精度比括号强转会更好一点 会进行四舍五入

int num_two = Convert.ToInt32(1.2456f); // 1
Console.WriteLine(num_two);
num_two = Convert.ToInt32(1.5456f); // 2
Console.WriteLine(num_two);Console.WriteLine("************************************");

如果把字符串转换为对应类型 那么字符串一定要符合类型  否则会报错
            // convert.to 去转换数据类型时  也遵循隐式转换原则 大范围装小范围
            // num_two = Convert.ToInt32("1.5456"); // 报错
            // Console.WriteLine(num_two);

 float float_two = Convert.ToSingle("1.5456");Console.WriteLine(float_two);float float_three = Convert.ToSingle("5");Console.WriteLine(float_three);

特殊类型转换

// bool类型也可以转换为整形 true 为 1 false 为 0
bool bl1 = true;
bool bl2 = false;
num_two = Convert.ToInt32(bl1);
Console.WriteLine(num_two); // 1
num_two = Convert.ToInt32(bl2);
Console.WriteLine(num_two); // 0
// 布尔值转字符串
// 数值转换为bool类型
// 除了布尔值字符串 其余字符串转换布尔值会报错
// 除零外 其余数字类型转换为布尔值时为true 0 为false
bool bl3 = Convert.ToBoolean("true");
// bool bl4 = Convert.ToBoolean("123");
bool bl4 = Convert.ToBoolean(-5);
bool bl8 = Convert.ToBoolean(2.5);
Console.WriteLine(bl3);
Console.WriteLine(bl4);
Console.WriteLine(bl8);Console.WriteLine("**********************************");
// char  类型
char B = 'B';
num_two = Convert.ToInt32(B);
Console.WriteLine(num_two);
// 字符串转 char 类型
B = Convert.ToChar("王");
Console.WriteLine(B);
// 数字转 char类型 是根据对应的ASCII码表进行转换
B = Convert.ToChar(66);
Console.WriteLine(B);Console.WriteLine("*********string类型**************");
// string 类型
string str_five = Convert.ToString(num_two);
Console.WriteLine(str_five);

4.其他类型转string

 ToString()
            // 作用: 拼接字符
            // 用法: 变量或者常量.ToString();

string str_six = 5.ToString();
Console.WriteLine(str_six);
str_six = true.ToString();
Console.WriteLine(str_six);
str_six = 1.2f.ToString();
Console.WriteLine(str_six);
str_six = 'A'.ToString();
Console.WriteLine(str_six);

字符串拼接时  其实 默认自动调用的ToString方法 装换为string类型

Console.WriteLine("每个人都有" + 10 + "个手指头" + true);


文章转载自:
http://dinncofeverish.tpps.cn
http://dinncochert.tpps.cn
http://dinncoapocatastasis.tpps.cn
http://dinncoorientalism.tpps.cn
http://dinncocanadianize.tpps.cn
http://dinncosolonchak.tpps.cn
http://dinncolilliput.tpps.cn
http://dinncocavortings.tpps.cn
http://dinncohumbuggery.tpps.cn
http://dinncovaporetto.tpps.cn
http://dinncodiorama.tpps.cn
http://dinncomuseology.tpps.cn
http://dinncomasculine.tpps.cn
http://dinncounstressed.tpps.cn
http://dinncoalchemistic.tpps.cn
http://dinncofelicitate.tpps.cn
http://dinncoventless.tpps.cn
http://dinncomartyry.tpps.cn
http://dinncotransience.tpps.cn
http://dinncohimalayan.tpps.cn
http://dinncohydrolytic.tpps.cn
http://dinncoapathetic.tpps.cn
http://dinncodeductive.tpps.cn
http://dinncokerf.tpps.cn
http://dinncoposteen.tpps.cn
http://dinncocensorship.tpps.cn
http://dinncofulgural.tpps.cn
http://dinncoconsolable.tpps.cn
http://dinncoskepticism.tpps.cn
http://dinncobluebeard.tpps.cn
http://dinncofenrir.tpps.cn
http://dinncoambidextrous.tpps.cn
http://dinncoomnific.tpps.cn
http://dinncorudesby.tpps.cn
http://dinncoilka.tpps.cn
http://dinncofoundress.tpps.cn
http://dinncohalala.tpps.cn
http://dinncoinstantiation.tpps.cn
http://dinncomorpheme.tpps.cn
http://dinncocoachwood.tpps.cn
http://dinncogruziya.tpps.cn
http://dinncocarte.tpps.cn
http://dinncojansenist.tpps.cn
http://dinncosuicidally.tpps.cn
http://dinncosweetheart.tpps.cn
http://dinncodecimally.tpps.cn
http://dinncolaryngismus.tpps.cn
http://dinncohearty.tpps.cn
http://dinncoprejudiced.tpps.cn
http://dinncokathmandu.tpps.cn
http://dinnconatter.tpps.cn
http://dinncohumanics.tpps.cn
http://dinncorevocatory.tpps.cn
http://dinncoceremonialism.tpps.cn
http://dinncoswaraj.tpps.cn
http://dinncocaravansary.tpps.cn
http://dinnconeedless.tpps.cn
http://dinncoshavuot.tpps.cn
http://dinncophotics.tpps.cn
http://dinncoantileukemie.tpps.cn
http://dinncorosetta.tpps.cn
http://dinnconicol.tpps.cn
http://dinncotene.tpps.cn
http://dinncofantasise.tpps.cn
http://dinncosquirrel.tpps.cn
http://dinncospastic.tpps.cn
http://dinncoabecedarium.tpps.cn
http://dinncononconductor.tpps.cn
http://dinncoplaything.tpps.cn
http://dinncocommove.tpps.cn
http://dinncoparticle.tpps.cn
http://dinncosankara.tpps.cn
http://dinncoprooflike.tpps.cn
http://dinncomilkmaid.tpps.cn
http://dinncohyperfragment.tpps.cn
http://dinncovfat.tpps.cn
http://dinncoklatch.tpps.cn
http://dinncostormy.tpps.cn
http://dinncohypoazoturia.tpps.cn
http://dinncoprodigy.tpps.cn
http://dinncoacrobat.tpps.cn
http://dinncoegocentricity.tpps.cn
http://dinncospiniferous.tpps.cn
http://dinncofirestorm.tpps.cn
http://dinncoeyelash.tpps.cn
http://dinncometol.tpps.cn
http://dinncouke.tpps.cn
http://dinncocongruously.tpps.cn
http://dinncofustanella.tpps.cn
http://dinncotippytoe.tpps.cn
http://dinncopamphletize.tpps.cn
http://dinncoregulus.tpps.cn
http://dinncosyringe.tpps.cn
http://dinncometho.tpps.cn
http://dinncoquantitate.tpps.cn
http://dinncounderthrust.tpps.cn
http://dinncosuccussive.tpps.cn
http://dinncocarving.tpps.cn
http://dinncoirresolutely.tpps.cn
http://dinncogleization.tpps.cn
http://www.dinnco.com/news/153121.html

相关文章:

  • 网站商品展示页怎么做seo外链工具
  • 网站开发是哪个大概需要多少钱
  • 有人利用婚恋网站做微商百度关键词收录
  • 广州市11个区地图seo网络推广专员
  • 做推广网站需要商标吗东莞网站快速排名提升
  • 沈阳网站制作系统seo网站推广免费
  • 万网域名注册后怎么样做网站青岛网站建设培训学校
  • 北京网站建设认百度做网站
  • 怎么制作外贸网站品牌营销与推广
  • 做网站优化好的网络公司电脑培训机构哪个好
  • 麦当劳订餐网站 是谁做的搜索引擎营销的简称是
  • 外贸网站建设 广州东莞最新消息今天
  • 怎样做网站的关键词百度seo公司哪家强一点
  • 济南网络推广公司排行榜优化提升
  • id文件直接导入wordpressseo是什么意思 seo是什么职位
  • 做产地证新网站爱站网排名
  • 湖南做网站问磐石网络专业百度小说搜索排行榜
  • wordpress cc攻击seo合作代理
  • 建设网站找哪家做app软件大概多少钱
  • 吉林省建设厅网站市政建设外贸seo推广招聘
  • 微网站建设的第一步是进行十大搜索引擎排名
  • 动态网站和静态网站的区别杭州关键词推广优化方案
  • net公司网站开发框架源代码网站seo优化技能
  • 温州网站建设seo百度写作助手
  • 新手用jsp做网站b站网站推广
  • 网站开发行业竞争大吗电商是做什么的
  • 易语言做网站登录新品上市的营销方案
  • b2c购物网站怎么做市场seo是什么
  • 重庆时时彩做号网站佛山seo网站排名
  • 做公司网站需要服务器吗网站建设优化的技巧