C# : Swift MT 103 Code 50K: element Parser

851 Views Asked by At

I'm getting FTS Message of Swift code MT 103. From Which I want to Parse 50K element and 59 element. But these element have not structure format. Some time the message occurs like below examples.

50K:AccountNumber
Name1
Name2
Address
City

50K:AccountNumber
Name1
Address
City

50K:AccountNumber
Name1
Address

Can any one help to identify Name and Address or any approach to be follow.

I've tried to create a list which contain starting text of Addresses like Flat, street, Plot, Road, House Number, House #, Town, Colony, Area, Block and Phase. But I'm thinking that I'm on wrong direction in identification.

1

There are 1 best solutions below

1
On

In your strings the Name part is delimited by the words "AccountNumber" and "Address" therefore you can use Split in the following way to get the name.

yourString.Split({"AccountNumber","Address "},StringSplitOptions.None)

part 1 of the resulting array will contain the value for name.

In order to obtain the value of address again you can use Split but this time you will have to split your string from Address and again part 1 of the resulting array will contain the value for address.