Loading...
Logo
Processing Forum
Let's say I have String. We'll call it mystring. 
Copy code
  1. String mystring = "Hello everyone, this is my String!";

How would I change a specific character in the String, say I wanted to change the comma to a period, or something like that, how would I do it?

Replies(1)




e.g.

https://forum.processing.org/topic/check-and-replace-certain-char#25080000001371625

also have a look at

http://processing.org/reference/String.html

there is stuff like indexOf and you can thus get the position of the comma and then with twice using substring go like

Copy code
  1. String newString = subStringFirstPart + "." + subStringSecondPart;

Greetings, Chrisir