An analysis of View the MathML sourceB+→KS0π+ and View the MathML sourceB+→KS0K+ decays is performed with the LHCb experiment. The pp collision data used correspond to integrated luminosities of 1 fb−11 fb−1 and 2 fb−12 fb−1 collected at centre-of-mass energies of View the MathML sources=7 TeV and View the MathML sources=8 TeV, respectively. The ratio of branching fractions and the direct CP asymmetries are measured to be View the MathML sourceB(B+→KS0K+)/B(B+→KS0π+)=0.064±0.009 (stat.)±0.004 (syst.), View the MathML sourceACP(B+→KS0π+)=−0.022±0.025 (stat.)±0.010 (syst.) and View the MathML sourceACP(B+→KS0K+)=−0.21±0.14 (stat.)±0.01 (syst.). The data sample taken at View the MathML sources=7 TeV is used to search for View the MathML sourceBc+→KS0K+ decays and results in the upper limit View the MathML source(fc⋅B(Bc+→KS0K+))/(fu⋅B(B+→KS0π+))<5.8×10−2 at 90% confidence level, where fcfc and fufu denote the hadronisation fractions of a View the MathML sourceb¯ quark into a View the MathML sourceBc+ or a B+B+ meson, respectively.