Domanda

I have a text of the form

1;#aa2;#dde4;#sdfsa6;#hjjs

I want to remove digit and ;# from the above string and keep the string as

aa
dde
sdfsa
hjjs

Is there a way like we do in C# to check if string contains <digit>;# and replace it with a
or a blank space.

I was trying to split on ;# as

=(Split(Fields!ows_Room.Value,";#")).GetValue(1)

but than the output is only aa2.

È stato utile?

Soluzione 2

Give a try to following expression.

    =Join(Split((System.Text.RegularExpressions.Regex.Replace(Fields!ows_Room.Value, "[0-9]", "").Trim(";").Trim("#")),";#"),” “)

Altri suggerimenti

You are getting aa2 only because GetValue(1) retruns the first indexed array value. Change you expression to

    = Join(Split(Fields!ows_Room.Value,";#"),” “)

If you want the output like

aa2
dde4
sdfsa6
hjjs

use this expression

    = Join(Split(Fields!ows_Room.Value,";#"),VBCRLF)
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top