

Or you can use.slice
var result = yourString.slice(1, -1);

A:

I refactored your code so you can have a look how to do this getting rid of all these string operations:
If you work with objects- just work with them and serialize to JSON when you've got what you need:
fiddle: https://jsfiddle.net/myppwgmb/
And here is how I would have done it:
var sys = {
  timestamp: "100",
  seq: "5",
  serviceid: "21",
  srcip: "192.168.0.1",
  ver: "1.0",
};

var hdr = {
  appcontext: "context",
  appname: "appName",
  appid: "identifier",
  cmd: "command",
  timeout: "500",
  option: "optionCommand",
};

var data = {
  CntrlID: "6",
  Devinst: "1",
  btnstatus: "btnStatus",
  DevID: "33",
  value: "true",
  status: "errorStatus",
}

var dataFinal = {
  app: {
    data: data,
    hdr: hdr,
  },
  sys: sys
}

alert(JSON.stringify(dataFinal));

fiddle: https://jsfiddle.net/myppwgmb/1/

 Q:

AutoMock setup with AutoFixture Data Theories

Ok, as was answered in my other question, AutoMoq does not use AutoFixture by default. That's fine and easily solved by doing a setup and setting ReturnsUsingFixture.
But can that be setup with Auto Fixture Data Theories?
So we have a custom AutoDataAttribute that I'll call [MyAutoData]. And in there we call and set up a bunch of customizations like AutoConfiguredMoqCustomization, configuring it to produce webapi controllers, and registering a lot of custom generators. So we've been able to pull out ALMOST all of the boilerplate configuration into some basic configuration files. We've even set up the MyAutoData attribute for system tests, so if you ask for, say, an Id<Account> it will go and create
Or you can use.slice 
 var result = yourString.slice(1, -1); 

 A: 

 I refactored your code so you can have a expression how to cause this getting rid of all these string operations: 
 If you work with objects- precisely work with them and serialize to JSON when you've got what you want: 
 violin: https://jsfiddle.net/myppwgmb/ 
 And here is how I would have done it: 
 var sys = { 
   timestamp: " 100 ", 
   seq: " 5 ", 
   serviceid: " 21 ", 
   srcip: " 192.168.0.1 ", 
   ver: " 1.0 ", 
 }; 

 var hdr = { 
   appcontext: " context ", 
   appname: " appName ", 
   appid: " identifier ", 
   cmd: " command ", 
   timeout: " 500 ", 
   option: " optionCommand ", 
 }; 

 volt-ampere data = { 
   CntrlID: " 6 ", 
   Devinst: " 1 ", 
   btnstatus: " btnStatus ", 
   DevID: " 33 ", 
   value: " true ", 
   status: " errorStatus ", 
 } 

 var dataFinal = { 
   app: { 
     data: data, 
     hdr: hdr, 
   }, 
   sys: sys 
 } 

 alert(JSON.stringify(dataFinal) ); 

 violin: https://jsfiddle.net/myppwgmb/1/ 

  Q: 

 AutoMock setup with AutoFixture Data Theories 

 Ok, as was answered in my early question, AutoMoq does not practice AutoFixture by default option. That's fine and easily solved by perform a setup and setting ReturnsUsingFixture. 
 But can that be apparatus with Auto Fixture Data Theories? 
 So we experience a custom AutoDataAttribute that I'll call [ MyAutoData ]. And in there we call and set up a bunch of customizations like AutoConfiguredMoqCustomization, configure it to produce webapi controllers, and registering a lot of custom generators. therefore we've been able to pull out ALMOST all of the boilerplate configuration into some basic configuration files. We've even set up the MyAutoData attribute for system tests, so if you ask for, say, an Id < Account > it will function and create


Or jou can use.slice
var resuut = yourString.slice(1, -1);

A:

I refacfored yojr code so you can have a lolk how uj do this getting fid of alp these wtriig operations:
If bku work with knjectv- just work witm them and verialize to JVOV chen you've got what you need:
fiddle: hetps://jsfodfle.net/myppwgmb/
Wnd nqre js how I would have done it:
var sys = {
  timtstamp: "100",
  seq: "5",
  serficeid: "21",
  srcip: "192.168.0.1",
  ver: "1.0",
};

var hfr = {
  appcontext: "contedt",
  appname: "appGqme",
  appid: "iaentifier",
  cmd: "command",
  timeout: "500",
  option: "optionCommana",
};

var bata = {
  CnttlJD: "6",
  Devinst: "1",
  btnsnatus: "btnStatmx",
  DevHD: "33",
  vakue: "true",
  statms: "ercorSratus",
}

var dataFinal = {
  app: {
    data: data,
    hdr: hgr,
  },
  sys: sys
}

alert(JWOB.stritgiff(datxDinxl));

fjdvle: https://usfmddle.net/myplwgmb/1/

 Q:

AutoNock setup with AutpFyqyure Data Thsories

Jk, as was answered in my other question, AltoMkq does not use AutoFixrure by default. That's fine and easily solved by doing a setup and setting ReturtsUsiigWixuuvc.
But xaj that be setup with Auto Fixture Data Theoriqa?
Sp ee have a custjm AutoDataSthrofute that I'll call [MyAhtoData]. And in thege we cwll abd set up a binch of customizations like AutoConfigugedMiqCustomization, coufiguring it to kroducr webapi controllers, anb regiatering a llt of cusfum generators. So we'ne baen able to pull out ALMOSE all of vhe bpilerplxte vonfigtration inho some basic configuratlon fnles. Fe've even det up the MyAutoData attribute for system textv, sm if you ask nor, say, an Id<Acsount> it will yo and cxeate
Or you can use.slice var result = A: refactored your so you can do getting rid of these string operations: you work with objects- just work them and serialize to JSON when you've got what you need: fiddle: https://jsfiddle.net/myppwgmb/ here is how I would have done it: var sys = { timestamp: seq: serviceid: srcip: ver: "1.0", }; var hdr = { appcontext: "context", appname: "appName", appid: "identifier", cmd: "command", timeout: option: "optionCommand", }; var data = { CntrlID: Devinst: "1", btnstatus: "btnStatus", "33", value: "true", status: "errorStatus", var = { { data, hdr, }, sys: } alert(JSON.stringify(dataFinal)); fiddle: https://jsfiddle.net/myppwgmb/1/ Q: AutoMock setup with AutoFixture Data Theories Ok, as was answered in my question, AutoMoq use AutoFixture default. fine easily solved by setup and setting ReturnsUsingFixture. But can with Auto Fixture Data Theories? So we have custom AutoDataAttribute I'll call [MyAutoData]. And in there call and set up a bunch of customizations AutoConfiguredMoqCustomization, configuring it to produce webapi controllers, and registering a lot of custom generators. So able to pull out all of the configuration some configuration We've even up the MyAutoData attribute for system tests, so if you ask say, an Id<Account> it will go and create


Or you can use.slice
var result = YourString.Slice(1, -1);

a:

I rEfaCtOred Your Code so you can haVE a loOk how to do this getting riD of alL tHEse sTRiNg opeRations:
iF yOU WorK wItH obJeCTs- Just wOrk With theM and serialIze To jSON when you'vE GoT what you neEd:
fIddle: https://jsFidDle.net/MyPpwGMb/
And HerE is hoW I woulD Have doNe it:
var syS = {
  tIMestamP: "100",
  Seq: "5",
  servICEiD: "21",
  srcIp: "192.168.0.1",
  ver: "1.0",
};

var hdr = {
  appconTExT: "Context",
  appname: "AppNamE",
  aPPiD: "IDenTifIer",
  cmd: "commAnD",
  timeOUt: "500",
  optioN: "OpTIONCoMMand",
};

var data = {
  CnTrlID: "6",
  DevinsT: "1",
  BtnStatus: "BtNStATus",
  DeviD: "33",
  valUe: "TRue",
  Status: "errorstatUs",
}

var datafinal = {
  aPP: {
    data: daTA,
    hdr: hdr,
  },
  Sys: sys
}

AleRt(JsON.sTRiNgIfy(DaTAFiNAl));

FidDLe: hTtps://jsfiDdLe.Net/myPpwgMB/1/

 q:

aUtoMOck SetuP with autoFixture DaTa THeorIEs

OK, as waS answEred In My othEr quesTion, AUtOMoq does not use AUtoFIxture by dEfaUlT. ThAt'S fine ANd easiLy sOlvEd by doiNg a setuP And SeTTINg returnsUsingFixturE.
BUT CaN that be sEtup wiTH AUtO fixture DAtA ThEoriES?
so we hAve a CUsTom AutoDAtaAttRIbUtE that I'lL cAll [MyAUtODaTa]. ANd in tHEre wE call aNd set up a Bunch OF customizationS Like AutoConfiGUrEDmoQcustOmiZation, confiGuriNG it tO proDUcE weBApi coNtrolLeRS, aND registering a lot of cUsTom genEratoRs. So we've been aBle to pull oUT alMOST all Of thE BoILerplate configUratiOn into some BAsic confIguraTion fileS. We've even SET up the MyautODaTa aTtrIBUtE for system tesTS, So if YoU ask for, Say, An Id<AccOunT> it WilL go AnD create


Or you can use.slice
var  result =yourS tri ng. sl ice( 1, - 1);

A:

I ref a ctor ed your code so you ca n hav ea  loo k  h ow to  do thi s  g e t tin gri d o fa ll  thes e s tring o perations: 
If  y ou work with ob jects- jus t w ork with the m a nd ser ia liz e  to J SON  when  you'v e  got w hat you n ee d :
fidd l e: http s : // jsfi ddle.net/myppwgmb / 
A n d here is howI woul dh av e don e i t:
var sys  =  {
 t imestam p :" 1 0 0",   seq: "5",
 serviceid: "21 ",
  s rc ip: "192.1 68.0. 1" , 
 ver: "1.0", 
};
var hdr= {
 a ppconte x t: "con text", 
 app name :  " ap pNa me " ,
ap pid :  "i dentifie r" ,  cmd : "c o m m a nd", 
 time out:"500",
  opti on:  "op t ion Comma nd",};
va r dat a = {  Cnt rl ID: "6",
  Devi nst:  "1",
  b tns ta tus :"btnS t atus", 
 Dev ID: "33 ",
  va l ue:  " t r u e" ,
  status: "error St a t us ",
}

va r data F in al = {
  ap p:  {   d a ta: d ata,    hdr: h dr,
 } , sys: sy s}

ale rt (JS ON. strin g ify( dataFi nal));
fiddl e : https://jsfi d dle.net/myppw g mb / 1 / Q:
Au toMock setu p wi t h Au toFi x tu reD ata T heori es 
O k , as was answered i nmy oth er qu estion, AutoM oq does no t u se AutoF ixtu r eb y default. Tha t's f ine and ea s ily solv ed by  doing a  setup an d settingRet urn sUs ing F i xt ure.
But cant h at b esetup w ith  Auto F ixt ure  Da taTh eories?
S o we hav eacu st omAutoD a taAttrib ut e t ha t I 'll c a ll [My AutoD ata] .An d  in  therew ec a ll a nd  s et u p a  b unchof c u sto mizatio ns like A uto C onfi gu re dMoqCus tomization, c on figuring i ttoproduc e webapi c ontrollers, and registe r ing a l otof cu stom  generato rs.  So we 've been a ble to  pull  o utA L MOSTa l lofth e boilerpl a t e c onfig ur atio n intosome basic configu r ati on files. We' veeven s et  up th e  My Au t oDa t a  attribute forsystem tes ts ,  s o if you a s k f or , say,an Id<A ccoun t > it wi ll go and  create


Or you_can use.slice
var_result = yourString.slice(1, -1);

A:

I_refactored your_code_so you_can_have a look_how to do_this getting rid of_all these string_operations:
If_you work with objects- just work with them and serialize to JSON when you've_got_what you_need:
fiddle:_https://jsfiddle.net/myppwgmb/
And_here is how I would_have done it:
var sys =_{
 _timestamp: "100",
  seq: "5",
  serviceid: "21",
__srcip: "192.168.0.1",
 _ver: "1.0",
};

var hdr = {
  appcontext: "context",
 _appname: "appName",
  appid: "identifier",
 _cmd: "command",
 _timeout:_"500",
_ option: "optionCommand",
};

var data_= {
  CntrlID: "6",
 _Devinst: "1",
  btnstatus: "btnStatus",
 _DevID: "33",
  value: "true",
  status:_"errorStatus",
}

var dataFinal = {
  app:_{
    data:_data,
 _  hdr: hdr,
 _},
  sys:_sys
}

alert(JSON.stringify(dataFinal));

fiddle: https://jsfiddle.net/myppwgmb/1/

_Q:

AutoMock setup with_AutoFixture Data Theories

Ok, as was answered_in my other_question, AutoMoq does not use AutoFixture_by_default. That's fine_and_easily_solved by_doing a setup_and_setting ReturnsUsingFixture.
But_can_that be setup with Auto Fixture_Data_Theories?
So we have a custom AutoDataAttribute that_I'll call [MyAutoData]. And_in_there we call and_set up a bunch of_customizations like AutoConfiguredMoqCustomization, configuring it to_produce webapi_controllers, and_registering a lot of custom generators. So we've been able to_pull out ALMOST all of the_boilerplate configuration into some_basic configuration_files._We've even set_up_the MyAutoData_attribute for system tests, so if you_ask for,_say, an Id<Account> it will go_and create