New line if

itsnotalina

Neues Mitglied
Hi Guys

I'm totally helpless.

I just started to make a PDF Form and need to adjust some things with the JavaScript editor. I'm a newbie.

So I have a dropdown with names which contains adress lines in the background.

An adress line is for example: Randomstreet 3 -- 3456 Randomcity

Now what i want to have at the end is this:

andomstreet 3
3456 Randomcity

What code do I have to use to add a new line to every "--"?

Thanks so much for your help!
 

KonradN

Super-Moderator
Mitarbeiter
If you just want to keep the result in one String then simply use String.replace to replace the " -- " with a newline:

And always be aware where you want to use the result. Depending on the target, '\n' might not be the best.
  • '\r' might be requested as newline (e.g. addWatermarkFromText method of Doc)
  • in HTML a '<BR>' might be required.

There is a API Reference for Adobe Acrobat Javascript sdk that might be of help to determine what is required:
 

KonradN

Super-Moderator
Mitarbeiter
I read, what the person wrote and I simply focused on that.

Und wenn der kleine Tobias nicht wieder aus dem Bällespieleparadies abgeholt werden möchte, dann sollte er ggf. versuchen, Argumente zu bringen statt einfach nur so dümmste Kommentare zu schreiben. Aber wie immer bei Tobias: Extrem viel (dümmste) Meinung und kein einziges Argument.
 

KonradN

Super-Moderator
Mitarbeiter
It is extremely rude not to answer in a language the questioner can understand. So much for Konrad's behavior here.
It was a reply directly to you. And if you think, that the language is that important: The rude part would have been an english post in a german only forum :)

I know - that is to much to understand for you. But don't worry - I am quite sure that some admin will solve this issue quickly :)
 
Ähnliche Java Themen

Ähnliche Java Themen

Neue Themen


Oben