在C ++中验证逗号分隔值消息 [英] validating the comma separated value message in C++

查看:48
本文介绍了在C ++中验证逗号分隔值消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何验证以逗号分隔的字符串

C1,2,12344,Mr,John, ; Chan,05/07/1976" .........

我需要根据一组规则验证每个字段值,例如

检查字符串是字符还是数字值,对于字符的

长度等。

I want to know how to validate a string which is comma separated
"C1","2","12344","Mr","John","Chan","05/07/1976".........
I need to validate each field value against a set of rules, for example
checking if the string is a character or a numeric value, for the
length of the character etc.

推荐答案

Nishanth写道:
Nishanth wrote:

我想知道如何验证以逗号分隔的字符串


" ; C1,2,12344,Mr,John,Chan,05/07 / 1976.........


我需要根据一组规则验证每个字段值,例如

检查字符串是字符还是数值,对于

字符的长度等。
I want to know how to validate a string which is comma separated
"C1","2","12344","Mr","John","Chan","05/07/1976".........
I need to validate each field value against a set of rules, for example
checking if the string is a character or a numeric value, for the
length of the character etc.



分隔stri进入字段,然后将每个子字段

与验证标准进行比较。其余部分留给读者练习


Separate the string into the fields, and then compare each subfield
against the validation criteria. The remainder is left as an exercise
for the reader.


嗨红,


可以你更具体。因为我是c ++编程的新手。

如何将字符串分成字段?我如何验证

每个人?


如果你可以帮我解决一些示例程序或某些网站

用这个来帮助初学者会很有帮助。


谢谢,

Nishanth


red floyd写道:
Hi Red,

Can you be more specific. as i am a newbie to c++ programming.
How do I separate the string into the fields? and how do I validate
each of them?

If you can help me out with some example programmes or some websites
which help out begginners with this it will be quite help full.

Thanks,
Nishanth

red floyd wrote:

Nishanth写道:
Nishanth wrote:

我想知道如何验证以逗号分隔的字符串

C1,2,12344,Mr,John,Chan,05/07 / 1976...... .....

我需要根据一组规则验证每个字段值,例如

检查字符串是字符还是数字值,

角色的长度等等。
I want to know how to validate a string which is comma separated
"C1","2","12344","Mr","John","Chan","05/07/1976".........
I need to validate each field value against a set of rules, for example
checking if the string is a character or a numeric value, for the
length of the character etc.



将字符串分隔成字段,然后比较每个子字段

违反验证标准。其余部分留给读者练习


Separate the string into the fields, and then compare each subfield
against the validation criteria. The remainder is left as an exercise
for the reader.


你好红色,


你能说得更具体吗?因为我是c ++编程的新手。

如何将字符串分成字段?我如何验证

每个人?


如果你可以帮我解决一些示例程序或某些网站

用这个来帮助初学者会很有帮助。


谢谢,

Nishanth


red floyd写道:
Hi Red,

Can you be more specific. as i am a newbie to c++ programming.
How do I separate the string into the fields? and how do I validate
each of them?

If you can help me out with some example programmes or some websites
which help out begginners with this it will be quite help full.

Thanks,
Nishanth

red floyd wrote:

Nishanth写道:
Nishanth wrote:

我想知道如何验证以逗号分隔的字符串

C1,2,12344,Mr,John,Chan,05/07 / 1976...... .....

我需要根据一组规则验证每个字段值,例如

检查字符串是字符还是数字值,

角色的长度等等。
I want to know how to validate a string which is comma separated
"C1","2","12344","Mr","John","Chan","05/07/1976".........
I need to validate each field value against a set of rules, for example
checking if the string is a character or a numeric value, for the
length of the character etc.



将字符串分隔成字段,然后比较每个子字段

违反验证标准。其余部分留给读者练习


Separate the string into the fields, and then compare each subfield
against the validation criteria. The remainder is left as an exercise
for the reader.


这篇关于在C ++中验证逗号分隔值消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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