截取年月日在hana中怎么写_取年月日的字符串方法

本文介绍了在HANA中如何截取字符串中的年月日。通过示例代码展示了如何利用字符串操作找到并提取年、月、日的详细步骤,包括使用IndexOfAny方法查找特定字符位置并创建字典记录这些位置。
摘要由CSDN通过智能技术生成

usingSystem;usingSystem.Collections.Generic;usingSystem.IO;usingSystem.Linq;usingSystem.Text;usingSystem.Threading.Tasks;namespace取年月日的字符串方法

{classProgram

{static void Main(string[] args)

{

Question();

}public static voidExercise1()

{//输入一个字符串,然后反转

Console.WriteLine("请输入字符串");string input =Console.ReadLine();#region MyRegion

//char[] chs = input.ToCharArray();//for (int i = 0; i < chs.Length / 2; i++)//{//char cTemp = chs[i];//chs[i] = chs[chs.Length - 1 - i];//chs[chs.Length - 1 - i] = cTemp;//}//Console.WriteLine(new string(chs));

#endregion

//ctrl + k + s + 选择

Console.WriteLine(MyReverseString(input));

Console.ReadKey();

}///

///反转字符串///

/// 输入的字符串

/// 返回翻转后的字符串

private static string MyReverseString(stringinput)

{char[

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值