Important: the maximum length of the string should be 15 characters. ...
I have been working on creating a Coffeescript function that incorporates common HTML for an object that is frequently used on my page. To make the content dynamic, I am passing a variable to the function which will be replaced each time it is called. Unfo ...
I'm encountering an issue with my Discord.io bot. I am attempting to run it on a Linux server, but the Linux version of Node.js keeps treating the contents of a string as a separate object, leading to the following TypeError: TypeError: Object IT'S ALIVE ...
Is there a way to extract words that begin with the symbol '$' from a text file? Here is an example of the text file (ascii): @ExtendedAttr = nvp_add(@ExtendedAttr, "severity", $severity, "description", $description, "eventID", $eventID, ...
I am in search of a solution that can interpret a string in php and execute basic math operations, providing a boolean result to determine if the expression is true or false. For instance: Sue inputs "3*{mysalary}/9=10000" PHP breaks this down into two ...
After attempting to extract values from a response by parsing it into separate strings, I encountered some difficulties. The response text looks like this: response = "Data1{ key1='4722**********6', key2='2107', key3=value{ ...
In my database, I have Arabic sentences that contain decimal unicodes for quotation marks and other elements. For example, here is a sample text: "كريم نجار: تداعيات “كورونا” ستغير مستقبل سوق السي ...
Recently, I developed a program for extracting data from an API that returns information in JSON format. However, when attempting to parse the data, I encountered a key error. Traceback (most recent call last): File "test.py", line 20, in <module> ...
I'm having trouble comparing two strings. They look similar visually, but the var_dump result is different. Can someone please help me with this issue? string(8) "СИ.pdf" string(7) "CИ.pdf" How can I correctly compare these two strings? ...
When opening a workbook using openpyxl, I typically use the following code: wb = load_workbook(r'seven.xlsx', data_only=True) However, there are times when the name of the spreadsheet is not known in advance, requiring me to modify the hardcoding to acco ...
When utilizing the "WithText" function within a Testcafe script, it appears to be case-sensitive. How can I modify it to be case-insensitive? For example, allowing both "Myname" and "myname" for a user input. It's problematic when a script fails due to t ...
Merchant Id|Merchant|Website|Transaction In Period|Voids In Period|Gross Sales Amount|Total Commision in Period 9766|Mountains Plus Outdoor Gear|www.MPGear.com|1|0|88.91|8.89 12447|Meritline.com|www.meritline.com|5|0|52.86|3.71 16213|East Coas ...
I have a string containing a series of coordinates that represent various polygons. Each polygon is closed, meaning it has the same starting and ending coordinates. My goal is to separate each polygon into its own string or list. '17.17165756225586 - ...
I have a rather unusual request. I am working with a string that goes through a complex processing function, resulting in a list. This list contains timestamps and text, essentially forming an LRC file (Lyric with track time). As I develop various Kodi (X ...
Recently, I encountered a straightforward issue regarding printing emojis in Python. After some research, I discovered three main methods to achieve this: Using UNICODE representation of the emoji Using CLDR names of the emoji Utilizing the emoji module ...
In my database, there is a field in the record table that contains prices in string format. The prices are unformatted and may vary: $12,000.50 $3.50 From $3.50 to $12,000.50 My goal is to extract the numerical value from these strings by removing all "$ ...
After conducting extensive research, I have come across various suggestions related to my topic. One such suggestion is checking if a character corresponds to a word boundary. However, I am uncertain if this is the exact solution I require for my situatio ...
After experimenting with different methods, I have found some challenges in calculating the time difference between two values separated by a colon. The times are received through an XML feed, giving me the flexibility to manipulate and convert the strings ...
Currently, I am viewing some string data in a browser that has been processed using python-node js express. The data looks something like this: In order to manipulate the data more effectively, I would like to convert it into JSON format that follows this ...
Received a Json object from a URL with values formatted like this: title:'u05d9u05d7u05e4u05d9u05dd' Attempting to convert these values into readable text, but struggling with them being interpreted as literal strings rather than unicode objects. Us ...
I am faced with the task of comparing two strings together. abc\r\ndef c\nde My goal is to determine the index of string 2 within string 1. Using the indexOf() method is not an option due to different line endings, so I require an altern ...
Is it possible to extract only important information from a user's calendar event descriptions obtained through the Google Calendar API? For example, if we have a string like the one below: <br>Hi, please keep this text.<br> <br>Bob ...
Here is an example of a string within a list: items = ["hello - this", "is - a", "sample - task", "i", "want - to", "do"] Is it possible to achieve the following output? items = ["hello-this", "is-a", "sample-task", "i", "want-to", "do"] I attempted to r ...
When attempting to load a dictionary into json, I encountered an error. strsdc = ''' {"ext":{"amznregion":["useast"],"someURL":"https://som_url.com/x/px/Iyntynt/{"c":"client&qu ...
The code below represents the program I have written: with open("WinUpdates.txt") as f: data=[] for elem in f: data.append(elem) with open("checked.txt", "w") as f: check=True for item in data: if "KB2982791" in item: ...
I am dealing with a nested list structure like this: [ ['3', ',', '1', ',', '0', ',', '2', ',', '0'], ['2', ',', '1', ',', ...
When using the Recurly API, the response contains the following text. My goal is to extract values from this string and assign them to PHP variables in the easiest way possible. Despite searching through various methods in the PHP manual, as a newcomer to ...
For instance: $strA = 'What are you talking about?'; $strB = 'aeiou'; I want to enclose all vowels in strB that match any characters in strA with a <span>. Is there an efficient way to achieve this? echo tagMatchingVowels($strA); ...
I'm facing a challenge with extracting numbers from a string that includes commas. If the comma is removed, the function works fine; however, when it's left in place, the function malfunctions. It's puzzling why the presence of a comma poses a problem for ...
After an extensive search, I haven't come across any informative posts regarding my specific inquiry. I'm currently dealing with a variable that holds a string and my objective is to split it into two separate variables. Consider this example: var str = ...
I've been given a task to shuffle a word that has more than 3 letters while keeping the first and last letters unchanged. The revised word should not be identical to the original, ensuring some sort of rearrangement is apparent. For example, when shuffli ...
I am working with a txt file that I have read as an array, where each line in the txt file is stored as an element in the array. My objective is to extract only the array elements that start with the word "Keywords:". I need to retrieve all the words follo ...
Greetings, I have a question that may seem novice, but I am eager to find the answer. Back when my programming language was VB6, I used the Split method just like in PHP. However, there seems to be a key difference. When I run the following code: $page_ar ...
I am trying to loop through a list of strings and replace any occurrence of a specific character, like '1', with a word. However, I'm puzzled as to why my current code is not working. for x in list_of_strings: x.replace('1', 'Ace') Just a heads up, t ...
Is there a way to remove the brackets and the quotation marks when putting media queries into an object and looping over them? The code works well, but the stylus is causing the output to have unwanted characters. Here's my code: $maxBreakpoints = { ...
Struggling with JavaScript data structures, I am trying to create a map in which the key is a string and the value is an array of two longs. For instance: var y = myMap["AnotherString"]; var firstNum = y[0][0]; var secondNum = y[0][1]; // perform opera ...
My code takes user input from a text box and needs to convert it into a 2D list of strings. The user input comes from a Jupyter Dash text input I am working on creating a design where the user does not have to quote the elements themselves and can simply ...
If I have a string of HTML, it might look something like this... <h2>Header</h2><p>all the <span class="bright">content</span> here</p> I am interested in manipulating the string by reversing all the words. For example ...
I'm trying to extract the inner HTML of multiple paragraph elements from a string and I need some help. Here's an example input: let HTML = "<p class="Paragraph" >Hello, World 1!</p><p class="Paragraph" >Hell ...
I have a requirement to modify an iframe src attribute generated dynamically by a BrightCove video player. Specifically, I need to eliminate certain GET parameters such as width and height, so that the width and height of the parent element take precedence ...
Is there a way to efficiently encode a random string into an alphanumeric-only string in JavaScript / NodeJS while still being able to decode it back to the original input? Any suggestion on the best approach for this would be greatly appreciated! ...
It seems like there might be an issue with character encoding. My JavaScript search function is unable to identify specific strings that contain certain special characters such as parentheses, asterisks, and numbers. The JavaScript code I am using is quit ...
Looking for the most efficient method to unpack a python string into separate fields I am working with data obtained from a TCP socket, which is packed in a string format received from the `recv` function of the socket. The format of the data is as follo ...
I have been working on a program that involves reading a JSON string through a user interface and using it to perform various functions, such as breaking down mathematical equations. However, I am encountering an error message: "TypeError: string indice ...
Upon examining the PHP Manual, it appears that there isn't a significant distinction between declaring a variable variable with double brackets or double dollar signs. $apple = 'red'; $$apple = 'delicious'; echo $red; // 'delicious' $orange = 'juicy'; ${ ...
In my quest to extract the specific content I need from countless pages, I have devised a reliable rule that works 99% of the time: //a[@class='popular class' and not (contains(text(),'text1')) and not (contains(text(),'text2'))] The remaining 1% of case ...
In need of help adding linebreakers to a JSON string for improved readability. val myString = "some string" val myObjectJson = ` { "example1": "value", "example2": $myString }` This will allow me to utilize ...
I utilized s3 select to extract specific data for display on my frontend. I converted an array of bytes to a buffer and then to a string as shown below: let dataString = Buffer.concat(records).toString('utf8'); The resulting string looked like ...
I am working with an object array containing multiple variables. let Novels = []; class Novel { constructor(isbn, title, author, edition, publication, year) { this.isbn = isbn; this.title = title; this.author = author; this.publicat ...
I need assistance with creating a JavaScript regular expression that matches the format "APL-101". 1) The letters before '-' must be in capital letters, without any special characters, and can be any length. 2) After '-', the string should only contain d ...
I have a single string that looks like this: "Opportunity >> Source = Email >> Status = New >> Branch = Mumbai" My goal is to truncate the string from the last occurrence of >>. Essentially, I want the resulting string to be: "Op ...
In my current project, I am dealing with a lengthy JSON text that contains movie titles. I need to extract these titles from the following pattern: ((((((( .","title":" AND ","type":" ))))))) After researching other solutions, I came across one appro ...
I am attempting to encode a user input file using a random ascii key. I have managed to generate the random key and convert the file contents into ascii, but I am struggling with how to apply the key for encryption. I have tried several approaches, but my ...
As a newcomer to Python, I recently made the switch to Python 3 and am currently getting comfortable with the format() function. My objective is to display temperatures in floating-point format using the print() function, for example: temperature = [23, ...
Looking to generate an array of strings that start with a random amount of letters (0 to more than 10) and end with numbers. For example: - S001, S002, ..., S015 - AB67116, AB67117, ..., AB67128 - G07, G08, G09, G10, G11 If given the starting string an ...
import random def generate_random_strings(characters): return [random.choice(characters) for _ in range(4)] if __name__ == '__main__': characters = 'ygobpr' print(generate_random_strings(characters)) What is the best way to obtain a list of 4 ...
I have an AWS Lambda function where I am sending a string as my final response let abc= `"phone_exist":"0","calls":"0","lastaction":"0"` callback(null,abc); Output: ""phone_exist":"0","calls":"0","lastaction":"0"" I'm confused about why th ...
Looking for a way to extract specific values from a string? let temp = 'Hi {{username}}, Your request with request id: {{requestId}} has been processed. Please contact your nearest shop.' Desiring an array like this from the string: ['userName', 'request ...
Looking to compare substrings within a matrix and strings within a list. l1=['phone','bag','name','after'] l2=[['phoneedjf','jshph o n ejsh','pho ne'], ['ffaf terekdl','a hf ter','fd af t e rls'], ['name s', 'ram es','her na me is'], ['ba gg in g','ba g p ...
Currently, I am working on a small Django 1.1 app and have encountered an issue related to Python while using commands to manage data retrieval and categorization flow. Additionally, I want to generate a summary using a third command. My development enviro ...
Currently, I'm working with a node.js program and I've come across this response: 'Content-Disposition': 'attachment; filename="tts.mp3"' Instead of using "tts.mp3," I have a variable named textToConvert. How can I modify it ...
I have a list of 'words' that I need to count below word_list = ['one','three'] In my pandas dataframe, there is a column containing text shown below. TEXT | -------------------------------------------| "Perhaps she ...
Recently, I've been working on a function that I'm trying to condense into a one-liner code for a challenge on Codewars. You can find the problem here. Here's the code snippet that I currently have: export class G964 { public static digPow = (n: numbe ...
Is it possible to change the color of FirstName only when there is text input? Currently, it turns green when there's text, but I want it to turn red when it's empty. How can this be achieved? $(document).on("click", '.btn-info.mailContact', functio ...
I am facing an issue while trying to append a string to an HTML element. It works perfectly fine with a single line string, but breaks when I try to split it into multiple lines. <div><h4 >List to do:</h4><span id="added"></span ...
Assuming I have a small set of strings: string1 = 'text here pri=1 more text urgent=True' string2 = 'more text here pri=5 urgent=False' string3 = 'another text pri=3 urgent=False' string4 = 'more text pri=10 urgent=True' I am wondering how to extract the ...
My dataset named rssfeeds has some unusual characters, how can I remove these unicodes and replace them with their original values? Here is a link to view my dataset: https://i.stack.imgur.com/CtYG0.png Any help would be greatly appreciated. ...
I have been working on a JavaScript function to cut strings into 140 characters, ensuring that words are not broken in the process. Now, I also want the text to make more sense by checking for certain characters (like ., ,, :, ;) and if the string is bet ...
function filterWords(match, before, after) { return before && after ? ' ' : '' } var regex = /(^|s)(?:y|x)(s|$)/g var sentence1 = ('x 1 y 2 x 3 y').replace(regex, filterWords) console.log(sentence1) sentence2 = ('x y 2 x 3 y').replace(regex, filterW ...
What is an efficient method for performing multiple string replacements quickly? I'm attempting to insert spaces to abbreviate English words like he'll -> he 'll he's -> he 's we're -> we 're we've -> we 've Additionally, I am adding spaces ...
I need help finding a JavaScript code for searching words in a text using a form and a search button. I found one that works for multiple words in a row, but it doesn't work if the words are mixed up. What changes should be made to fix this issue? Any adv ...
There are strings in the data frame that appear as 'Temp (°C)', 'Dew Point Temp (°C)', 'Rel Hum (%)', and 'Wind Dir (10s deg)’. I want to extract only 'Temp', 'Dow Point Temp', 'Rel Hum&a ...
In the code snippet provided, I am combining variables to create a path to another existing object and its attribute. The issue is that I always receive a string, but I would like to somehow convert it into an object. // SET CUSTOM CONTENT FOR COLUMN IF ...
As a beginner in Python, I am currently exploring the format method. This information is from a book where I learning Python programming: The format method in Python involves substituting each argument value into the specified place. The specifications c ...
Looking to retrieve specific elements like host/username from the following string format. { "username":"admin", "password":"admin1234", "engine":"mysql", "host":"toolsdata.us-e ...