Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have a challenge question like "What is your favorite movie?". There could be any question like this. I need last word of the question i.e. movie. without question mark.
Try this
String question = "What is your favorite movie";
String lastWord = question .substring(question .lastIndexOf(" ")+1);
When you select the element containing your challenge question, you can call .getText() (in Java; similar in other languages) to get the text inside. Then, you can use regular expressions or substring utilities in your language to strip out the last word.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 months ago.
Improve this question
What is a proper Regex code to allow special characters like . _ - in email field
I have this Regex right now /^[a-zA-Z0-9]+#[a-zA-Z0-9]+\.[A-Za-z]+$/,
The above Regex only allow e-mails such as joedow#gmail.com
joe.dow#gmail.com does not work
How can I fix this ?
Just add those characters to the Regex:
^[a-zA-Z0-9\._-]+#[a-zA-Z0-9]+\.[A-Za-z]+$
https://regex101.com/r/xKkKIQ/1
This will make the regex consider ., _ and -. If you want any other characters, add them in the same way.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 months ago.
Improve this question
I have a Google Sheet which is constantly being populated via a Zapier zap. In one of the columns, I receive a PayPal "descriptor" which contains a unique identifier I need to do some look ups on other tabs within the same document.
Can someone point me in the direction of the correct REGEX to use to strip off the front and end of the string, for example:
Annual Fee-66421763-07142022191540
I would like to just have the piece in between the hyphens so the output reads simply:
66421763
Now, the front section will likely always read the same, the middle (the piece I want to extract) will be different and could change length too, as will the end section after the dash.
Any suggestions on how to achieve this would be great.
try:
=REGEXEXTRACT(A1; "-(\d+)-")
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
When using C programming language, I have no idea how to put a user input to an array.
I need to get integers from the user in from of:
printf("Enter numbers. Separate each by a comma: ");
How can I put each number into an array?
This is a very helpful link
Also look up this too for clarification on Console.Read & Console.Readline
Difference between Console.Read() and Console.ReadLine()?
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I want to split a string i have "msg 10 2" into different strings & ints. so instead of having
msg 10 2
I can take each as a seperate parameter can print:
msg
10
2
I use the variable to define a message:
char msg[30] = "msg 10 2";
I then want to take each field as seperate values/parameters.
Thanks
If you know your string will always follow the format string int int, then you could also use sscanf.
Use strtok (which you already tagged) and atoi.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have a string
"heya64 this is21 a good89 day91"
I have to sort in such way that , first each word have to sorted like,
46ahey and then these words need to be sorted with other words. So the result has to be like the one below,
"12is 19ady 46aehy 89dgoo a hist"
Can you please tell me how to do this mostly in scripting,bash or perl . If not atleast good algorithm in c language
The algorithm to sort this problem is simple, just like you said in your question description, sort characters in each word first, then sort these sorted-word again.
Like this:
$ echo heya64 this is21 a good89 day91 | perl -anE 'say(join " ", sort(map { join "", sort split // } #F))'
12is 19ady 46aehy 89dgoo a hist