python大小写转换程序

python大小写转换程序,第1张

Python大小写转换:

1.lower()。将字符串中的大写字母转换成小写字母。语法:str.lower()

2.upper()。将字符串的小毁橡写字母转换为大写字母。语法:str.upper()

3.capitalize()。将字符串的第一个字母变成大写,其余字母变为小写。语法:str.capitalize()

4.title()。返回一个满足标题格式的字符串,即所有英文单词首字母大纤散旁写,其余英文字母小写。语法:str.title()

5.swapcase()。将字符串str中的大小写字母同时进行互换,即将字符串str中的大写字母转换为小写字母,将小写字母转换为大写字母。语法掘则:str.swapcase()。

我前两天正好写了这样一个程序渗悔槐:(C#的)

你首先丛友要下载 iTextSharp.dll文件,之后添加前坦到引用中

我给你提供一个类 :

public void ExportDataIntoPDF(string pathName, String path)

{//导出至PDF

iTextSharp.text.Document document = new iTextSharp.text.Document()

try

{

iTextSharp .text .pdf .PdfWriter .GetInstance (document, new FileStream(pathName, FileMode.CreateNew ))

document.Open()

iTextSharp.text.pdf.BaseFont bfChinese = iTextSharp.text.pdf.BaseFont.CreateFont("C:\\WINDOWS\\Fonts\\simsun.ttc,1", iTextSharp.text.pdf.BaseFont.IDENTITY_H, iTextSharp.text.pdf.BaseFont.NOT_EMBEDDED)

iTextSharp.text.Font Titlefont = new iTextSharp.text.Font(bfChinese, 16, iTextSharp.text.Font.BOLD , new iTextSharp.text.Color(0, 0, 0))

document.Add(new Paragraph(" 将图片转成PDF:" + "\n", Titlefont))

iTextSharp.text.Image je = iTextSharp.text.Image.GetInstance(path)//path就是函数入参,即你要转成PDF的图片路径

document.Add(je)

}

catch (Exception de)

{

MessageBox .Show (de.ToString())

}

document.Close()

}

你调用这个类就ok了

1、打开vc软件,新建一个空白的vc项目文件:

2、编写转换程序,首先添加头文件,在main主函数中定义int类型变量sum,count,再定义double类型变量todouble,没枣并进行强制类型转换,强制转换的格式就是孝羡括号加要转换的类型,最后使用printf打印枯慎拆结果:

3、编译运行程序,查看转换的结果。以上就是C语言中Int和double转换的 *** 作步骤:


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/yw/12533574.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2025-08-26
下一篇2025-08-26

发表评论

登录后才能评论

评论列表(0条)

    保存