As per
documentation[
^], a
reverse
function is unavailable. There's only set of function for expression column, i.e.:
Convert
,
Len
,
IsNull
,
Iif
,
Trim
and
Substring
.
If you would like to Reverse text, you may use Linq query. Example:
DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn("Name", typeof(string)));
dt.Columns.Add(new DataColumn("CarType", typeof(string)));
dt.Rows.Add(new object[]{"Skoda", null});
dt.Rows.Add(new object[]{"Volkswagen", "Business"});
dt.Rows.Add(new object[]{"Mazda", "Personal"});
dt.Rows.Add(new object[]{"Renault", "Business"});
var result = dt.AsEnumerable()
.Select(x=>new
{
Name = x.Field<string>("Name"),
CarType = x.Field<string>("CarType"),
ReversedName = string.Join("", x.Field<string>("Name").Reverse())
})
.ToList();
Result:
Name CarType ReversedName
Skoda null adokS
Volkswagen Business negawskloV
Mazda Personal adzaM
Renault Business tluaneR