/    Sign up×
Community /Pin to ProfileBookmark

hey guys, i have a string “CONNECT(value1,value2,value3)”. i wanna break it up into 2 parts “CONNECT” and “(value1,value2,value3)”. how can i go about doing this, or does someone have a method already prepared?

to post a comment
Java

1 Comments(s)

Copy linkTweet thisAlerts:
@Khalid_AliDec 08.2005 — there are multiple ways of doing this..you can use StringTokenizer class or use string function split()..

String str = "CONNECT(value1,value2,value3)";

String[] arr = str.split("(");

now you will have to values in the arr array

arr[0] = "CONNECT" and etc.....
×

Success!

Help @keko2005 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...