如何根据数据库拆分字符串和转换 [英] how to split string and convert according to database

查看:83
本文介绍了如何根据数据库拆分字符串和转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想拆分ABCDE0060GHIJKL037Mxxx根据数据库值将此字符串转换为以下格式



格式化的字符串代码是

ABCDE 0060 GHIJ KL 037 XXX



条件是

1)它检查ABCDE是否存储在数据库中(如果存在)然后将ABCDE更改为XXXXX对于剩余的字符串相同。

解决方案

你可以像这样使用子字符串..

 str =   ABCDE 0060 GHIJ KL 037 XXX; 
retString = str.Substring( 0 5 );


I want to split ABCDE0060GHIJKL037Mxxx convert this string into the following format according to database value

The formatted String code is
ABCDE 0060 GHIJ KL 037 XXX

condition is
1) It checks whether ABCDE is store in database or not if present then change that ABCDE to XXXXX same for remaining string.

解决方案

you can use Substring Like this ..

str = "ABCDE 0060 GHIJ KL 037 XXX ";
       retString = str.Substring(0, 5);


这篇关于如何根据数据库拆分字符串和转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆