php - How to trim a new line character from JSON encoded string? -


i developing android application communicates php server via json.

in application, encoding key json send server. after encoding,when debug key in logcat, showing new line character @ end of value:

the logcat showing me that:

{"accesskey":"123456789\n"}

because of this,php server won't accept json values.

is there method or suggestions remove new line character? have googled this, can't find satisfactory solution.

if fix on server php should trim response values using trim

now in java method on string object. string.trim();

this should strip out \n or other trailing whitespace


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -